3v4l.org

run code in 300+ 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."); 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/E94HH
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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E94HH
function name:  do_stuff
number of ops:  10
compiled vars:  !0 = $b, !1 = $defined
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, 0
    6     2        INIT_FCALL                                               'trigger_error'
          3        SEND_VAL                                                 'If+I+fixed+the+undefined+variable+but+enabled+this+line+instead%2C+it+will+also+turn+b+from+an+object+into+a+string%21+So+user-triggered+notices+bork+it+as+well.'
          4        DO_ICALL                                                 
    8     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAL                                                 'In+function%3A'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
    9     9      > RETURN                                                   null

End of function do_stuff

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.86 ms | 1395 KiB | 17 Q