Skip to content

Commit

Permalink
Unconditionally apply SplPriorityQueue workaround for php >= 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Feb 5, 2021
1 parent 7695eec commit b344d5a
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions packages/zend-stdlib/library/Zend/Stdlib/SplPriorityQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ class Zend_Stdlib_SplPriorityQueue extends SplPriorityQueue implements Serializa
*/
protected $serial = PHP_INT_MAX;

/**
* @var bool
*/
protected $isPhp53;

/**
* Constructor
*
* @return void
*/
public function __construct()
{
$this->isPhp53 = version_compare(PHP_VERSION, '5.3', '>=');
}

/**
* Insert a value with a given priority
*
Expand All @@ -67,10 +52,8 @@ public function insert($datum, $priority)
// hack around it to ensure that items registered at the same priority
// return in the order registered. In the userland version, this is not
// necessary.
if ($this->isPhp53) {
if (!is_array($priority)) {
$priority = array($priority, $this->serial--);
}
if (!is_array($priority)) {
$priority = array($priority, $this->serial--);
}
parent::insert($datum, $priority);
}
Expand Down

0 comments on commit b344d5a

Please sign in to comment.