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(); doSomething($a->foo); doSomethingRef($a->foo); var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d1Lcc
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_FCALL                                               'dosomething'
          4        FETCH_OBJ_R                                      ~4      !0, 'foo'
          5        SEND_VAL                                                 ~4
          6        DO_FCALL                                      0          
   23     7        INIT_FCALL                                               'dosomethingref'
          8        FETCH_OBJ_W                                      $6      !0, 'foo'
          9        SEND_REF                                                 $6
         10        DO_FCALL                                      0          
   25    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

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