3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function test(A $dep = null){ print_r($dep?$dep:"null"); } } $a = new A(); $b = new A(); $a->test(); $a->test($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d5DAl
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   10     3        NEW                                              $5      'A'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   11     6        INIT_METHOD_CALL                                         !0, 'test'
          7        DO_FCALL                                      0          
   12     8        INIT_METHOD_CALL                                         !0, 'test'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d5DAl
function name:  test
number of ops:  9
compiled vars:  !0 = $dep
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      null
    5     1        INIT_FCALL                                               'print_r'
          2      > JMPZ                                                     !0, ->5
          3    >   QM_ASSIGN                                        ~1      !0
          4      > JMP                                                      ->6
          5    >   QM_ASSIGN                                        ~1      'null'
          6    >   SEND_VAL                                                 ~1
          7        DO_ICALL                                                 
    6     8      > RETURN                                                   null

End of function test

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.18 ms | 1395 KiB | 15 Q