PHP » GoLang |
login |
register |
about
|
GoLang pht\Queue::front
request it (381)
GoLang replacement for PHP's pht\Queue::front
[edit | history]
pht\Queue::front(PECL pht >= 0.0.1) pht\Queue::front — Returns the first value from a queue DescriptionThis method will remove a value from the front of the queue (in constant time). Attempting to return the front value from an empty queue will result in an Error exception. Caution
Due to the fact that all values in a pht\Queue are serialised, extracting a value from the queue will require it to be deserialised. This can incur a noticeable performance hit if the inspection of the queue's front value is performed within a loop. ParametersThis function has no parameters. Return ValuesThe value on the front of the queue. Examples
Example #1 Retrieving the front value of a queue
<?php The above example will output: int(1)
Example #2 Retrieving the front value in a loop (bad example - don't do this)
<?php
Example #3 Retrieving the front value in a loop (good example)
<?php |
more
Recently updated
more
Most requested
more
Last requests
|