3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public $a, $b; public function __construct($a, $b) { $this->a = $a; $this->b = $b; } public function doSomethingWithA() { /**/ } public function doSomethingWithB() { /**/ } public function doSomethingWithAandB() { /**/ } } // test 1 $c = new C("foo", null); var_dump($c->a === "foo"); // test 2 $c = new C(null, "foo"); var_dump($c->b === "foo");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jf8iA
function name:  (null)
number of ops:  21
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'C'
          1        SEND_VAL_EX                                              'foo'
          2        SEND_VAL_EX                                              null
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   17     5        INIT_FCALL                                               'var_dump'
          6        FETCH_OBJ_R                                      ~4      !0, 'a'
          7        IS_IDENTICAL                                     ~5      ~4, 'foo'
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
   20    10        NEW                                              $7      'C'
         11        SEND_VAL_EX                                              null
         12        SEND_VAL_EX                                              'foo'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !0, $7
   21    15        INIT_FCALL                                               'var_dump'
         16        FETCH_OBJ_R                                      ~10     !0, 'b'
         17        IS_IDENTICAL                                     ~11     ~10, 'foo'
         18        SEND_VAL                                                 ~11
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

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

End of function __construct

Function dosomethingwitha:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jf8iA
function name:  doSomethingWithA
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   null

End of function dosomethingwitha

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

End of function dosomethingwithb

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

End of function dosomethingwithaandb

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.23 ms | 1400 KiB | 15 Q