3v4l.org

run code in 200+ PHP versions simultaneously
<?php class A{ function do_stuff(&$b) { var_dump('Before in function:', $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('After 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/fZij6
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      :23
         1        DO_FCALL                                      0          
         2        QM_ASSIGN                                                !0
  15     3        NEW                                              $5      :19
         4        DO_FCALL                                      0          
         5        QM_ASSIGN                                                !1
  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                                                 
  20    13      > RETURN                                                   1

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

End of function do_stuff

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 7.4.0