3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $foo = 'bar'; } function doSomething($prop) { \strtoupper($prop); } function doSomethingRef(&$prop) { \strtoupper($prop); } $a = new A(); $foo =& $a->foo; doSomething($foo); doSomethingRef($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nKITi
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   21     3        FETCH_OBJ_W                                      $5      !0, 'foo'
          4        ASSIGN_REF                                               !1, $5
   23     5        INIT_FCALL                                               'dosomething'
          6        SEND_VAR                                                 !1
          7        DO_FCALL                                      0          
   24     8        INIT_FCALL                                               'dosomethingref'
          9        SEND_REF                                                 !1
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nKITi
function name:  doSomething
number of ops:  5
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'strtoupper'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   13     4      > RETURN                                                   null

End of function dosomething

Function dosomethingref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nKITi
function name:  doSomethingRef
number of ops:  5
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        INIT_FCALL                                               'strtoupper'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   18     4      > RETURN                                                   null

End of function dosomethingref

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.58 ms | 1398 KiB | 17 Q