3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); final class Stacker { private array $stack = []; public function push($obj): Stacker { $this->stack[] = $obj; return $this; } public function shift() { return array_shift($this->stack); } public function pop() { return array_pop($this->stack); } } $stack = new Stacker(); $stack->push(1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h2TW1
function name:  (null)
number of ops:  7
compiled vars:  !0 = $stack
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Stacker'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'push'
          4        SEND_VAL_EX                                              1
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Stacker:
Function push:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h2TW1
function name:  push
number of ops:  9
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_OBJ_W                                      $1      'stack'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
    7     4        FETCH_THIS                                       ~3      
          5        VERIFY_RETURN_TYPE                                       ~3
          6      > RETURN                                                   ~3
    8     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function push

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

End of function shift

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

End of function pop

End of class Stacker.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.67 ms | 1396 KiB | 17 Q