3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c { var $v = 'none'; function __construct($v) { $this->v = $v; } } function cf($c, $v) { $c->v = $v; } $c = new c('init'); $c1 = $c; cf($c, 'changed'); var_dump($c); var_dump($c1); //output php5 //php5 fix output $c1 to '123', $c2 to 'none' //output php4, fix capbility //php4 fix output $c1 to '123', $c2 to '123'
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BXUUI
function name:  (null)
number of ops:  16
compiled vars:  !0 = $c, !1 = $c1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $2      'c'
          1        SEND_VAL_EX                                              'init'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   17     4        ASSIGN                                                   !1, !0
   18     5        INIT_FCALL                                               'cf'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 'changed'
          8        DO_FCALL                                      0          
   20     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   22    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   27    15      > RETURN                                                   1

Function cf:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BXUUI
function name:  cf
number of ops:  5
compiled vars:  !0 = $c, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        ASSIGN_OBJ                                               !0, 'v'
          3        OP_DATA                                                  !1
   14     4      > RETURN                                                   null

End of function cf

Class c:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BXUUI
function name:  __construct
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'v'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function __construct

End of class c.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.9 ms | 1399 KiB | 16 Q