3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $foo = []; function add($name, $value, $priority = 500) { $this->foo[$name][$priority][] = $value; } public function get() { return $this->foo; } } $foo = new Foo; $foo->add('foo', 'a'); $foo->add('foo', 'a', 1000); $foo->add('foo', 'b'); $foo->add('foo', 'c', 0); $foo->add('foo', 'd', 23); var_dump($foo->get());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/18a0u
function name:  (null)
number of ops:  32
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_METHOD_CALL                                         !0, 'add'
          4        SEND_VAL_EX                                              'foo'
          5        SEND_VAL_EX                                              'a'
          6        DO_FCALL                                      0          
   17     7        INIT_METHOD_CALL                                         !0, 'add'
          8        SEND_VAL_EX                                              'foo'
          9        SEND_VAL_EX                                              'a'
         10        SEND_VAL_EX                                              1000
         11        DO_FCALL                                      0          
   18    12        INIT_METHOD_CALL                                         !0, 'add'
         13        SEND_VAL_EX                                              'foo'
         14        SEND_VAL_EX                                              'b'
         15        DO_FCALL                                      0          
   19    16        INIT_METHOD_CALL                                         !0, 'add'
         17        SEND_VAL_EX                                              'foo'
         18        SEND_VAL_EX                                              'c'
         19        SEND_VAL_EX                                              0
         20        DO_FCALL                                      0          
   20    21        INIT_METHOD_CALL                                         !0, 'add'
         22        SEND_VAL_EX                                              'foo'
         23        SEND_VAL_EX                                              'd'
         24        SEND_VAL_EX                                              23
         25        DO_FCALL                                      0          
   22    26        INIT_FCALL                                               'var_dump'
         27        INIT_METHOD_CALL                                         !0, 'get'
         28        DO_FCALL                                      0  $9      
         29        SEND_VAR                                                 $9
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Class Foo:
Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/18a0u
function name:  add
number of ops:  9
compiled vars:  !0 = $name, !1 = $value, !2 = $priority
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      500
    7     3        FETCH_OBJ_W                                      $3      'foo'
          4        FETCH_DIM_W                                      $4      $3, !0
          5        FETCH_DIM_W                                      $5      $4, !2
          6        ASSIGN_DIM                                               $5
          7        OP_DATA                                                  !1
    8     8      > RETURN                                                   null

End of function add

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/18a0u
function name:  get
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'foo'
          1      > RETURN                                                   ~0
   12     2*     > RETURN                                                   null

End of function get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.14 ms | 1392 KiB | 15 Q