3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A{ function do_stuff(&$b) { $defined = 0; #trigger_error("If I fixed the undefined variable but enabled this line instead, it will also turn b from an object into a string! So user-triggered notices bork it as well."); $x = $undefined || $defined ? 14 : 0; var_dump('In function:', $b); } } class B{} $a = new A(); $b = new B(); $a->do_stuff($b); var_dump('After function:', $b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VqsdQ
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   NEW                                                  $2      'A'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   15     3        NEW                                                  $5      'B'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !1, $5
   17     6        INIT_METHOD_CALL                                             !0, 'do_stuff'
          7        SEND_VAR_EX                                                  !1
          8        DO_FCALL                                          0          
   19     9        INIT_FCALL                                                   'var_dump'
         10        SEND_VAL                                                     'After+function%3A'
         11        SEND_VAR                                                     !1
         12        DO_ICALL                                                     
         13      > RETURN                                                       1

Class A:
Function do_stuff:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/VqsdQ
function name:  do_stuff
number of ops:  14
compiled vars:  !0 = $b, !1 = $defined, !2 = $x, !3 = $undefined
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        ASSIGN                                                       !1, 0
    7     2      > JMPNZ_EX                                             ~5      !3, ->4
          3    >   BOOL                                                 ~5      !1
          4    > > JMPZ                                                         ~5, ->7
          5    >   QM_ASSIGN                                            ~6      14
          6      > JMP                                                          ->8
          7    >   QM_ASSIGN                                            ~6      0
          8    >   ASSIGN                                                       !2, ~6
    8     9        INIT_FCALL                                                   'var_dump'
         10        SEND_VAL                                                     'In+function%3A'
         11        SEND_VAR                                                     !0
         12        DO_ICALL                                                     
    9    13      > RETURN                                                       null

End of function do_stuff

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.95 ms | 3340 KiB | 14 Q