3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PushAndPull { private $queue=array(); public function push($push) { array_push($this->$queue,$push); } public function pull() { return array_shift($this->$queue); } } $obj = new PushAndPull(); $obj->push(1); $obj->pull();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/viGIK
function name:  (null)
number of ops:  9
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'PushAndPull'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_METHOD_CALL                                         !0, 'push'
          4        SEND_VAL_EX                                              1
          5        DO_FCALL                                      0          
   23     6        INIT_METHOD_CALL                                         !0, 'pull'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class PushAndPull:
Function push:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/viGIK
function name:  push
number of ops:  7
compiled vars:  !0 = $push, !1 = $queue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'array_push'
          2        FETCH_OBJ_W                                      $2      !1
          3        SEND_REF                                                 $2
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   12     6      > RETURN                                                   null

End of function push

Function pull:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/viGIK
function name:  pull
number of ops:  6
compiled vars:  !0 = $queue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'array_shift'
          1        FETCH_OBJ_W                                      $1      !0
          2        SEND_REF                                                 $1
          3        DO_ICALL                                         $2      
          4      > RETURN                                                   $2
   18     5*     > RETURN                                                   null

End of function pull

End of class PushAndPull.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.52 ms | 1395 KiB | 17 Q