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, $c->b); 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/0Mede
function name:  (null)
number of ops:  27
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
   18     5        INIT_FCALL                                               'var_dump'
          6        FETCH_OBJ_R                                      ~4      !0, 'a'
          7        SEND_VAL                                                 ~4
          8        FETCH_OBJ_R                                      ~5      !0, 'b'
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                                 
   20    11        INIT_FCALL                                               'var_dump'
         12        FETCH_OBJ_R                                      ~7      !0, 'a'
         13        IS_IDENTICAL                                     ~8      ~7, 'foo'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
   23    16        NEW                                              $10     'C'
         17        SEND_VAL_EX                                              null
         18        SEND_VAL_EX                                              'foo'
         19        DO_FCALL                                      0          
         20        ASSIGN                                                   !0, $10
   24    21        INIT_FCALL                                               'var_dump'
         22        FETCH_OBJ_R                                      ~13     !0, 'b'
         23        IS_IDENTICAL                                     ~14     ~13, 'foo'
         24        SEND_VAL                                                 ~14
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Class C:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Mede
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/0Mede
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/0Mede
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/0Mede
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:
147.83 ms | 1405 KiB | 15 Q