3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $x; public function __construct($x) { $this->x = $x; } private static $i = 0; private static function a($x) { return new self($x.(self::$i++)); } public static function b($y) { return array_map(array("Foo", "a"), array_merge($y, $y)); } } var_dump(Foo::b(array("a", "b", "c")));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KP6LV
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'Foo', 'b'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KP6LV
function name:  __construct
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'x'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function __construct

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KP6LV
function name:  a
number of ops:  8
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        NEW                          self                $1      
          2        POST_INC_STATIC_PROP                             ~2      'i'
          3        CONCAT                                           ~3      !0, ~2
          4        SEND_VAL_EX                                              ~3
          5        DO_FCALL                                      0          
          6      > RETURN                                                   $1
   14     7*     > RETURN                                                   null

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KP6LV
function name:  b
number of ops:  11
compiled vars:  !0 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        INIT_FCALL                                               'array_map'
          2        SEND_VAL                                                 <array>
          3        INIT_FCALL                                               'array_merge'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                         $2      
          9      > RETURN                                                   $2
   18    10*     > RETURN                                                   null

End of function b

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.21 ms | 1396 KiB | 19 Q