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; $foo = 'something'; doSomething($foo); doSomethingRef($foo); var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Vmbb
function name:  (null)
number of ops:  16
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
   22     5        ASSIGN                                                   !1, 'something'
   24     6        INIT_FCALL                                               'dosomething'
          7        SEND_VAR                                                 !1
          8        DO_FCALL                                      0          
   25     9        INIT_FCALL                                               'dosomethingref'
         10        SEND_REF                                                 !1
         11        DO_FCALL                                      0          
   27    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Vmbb
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/9Vmbb
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:
158.38 ms | 944 KiB | 20 Q