3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $x; public function __construct($x) { $this->x = $x; } public function foo() { echo "Yay ({$this->x})!\n"; } } $foos = array(); for($i=0;$i<10;$i++) { $foos[] = new Foo($i); } $foos[4]->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 3
Branch analysis from position: 11
Branch analysis from position: 3
filename:       /in/82mXm
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foos, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->9
   11     3    >   NEW                                              $5      'Foo'
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
          6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  $5
   10     8        PRE_INC                                                  !1
          9    >   IS_SMALLER                                               !1, 10
         10      > JMPNZ                                                    ~8, ->3
   14    11    >   FETCH_DIM_R                                      ~9      !0, 4
         12        INIT_METHOD_CALL                                         ~9, 'foo'
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

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

End of function __construct

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/82mXm
function name:  foo
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ROPE_INIT                                     3  ~2      'Yay+%28'
          1        FETCH_OBJ_R                                      ~0      'x'
          2        ROPE_ADD                                      1  ~2      ~2, ~0
          3        ROPE_END                                      2  ~1      ~2, '%29%21%0A'
          4        ECHO                                                     ~1
          5      > RETURN                                                   null

End of function foo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.73 ms | 1395 KiB | 13 Q