3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function &__call($foo, $bar) { static $cnt = 0; $cnt++; return $cnt; } } $f = new foo(); $x = $f->bar(); var_dump($x); $a =& $f->bar(); var_dump($a); $a++; $b = $f->bar(); var_dump($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kgf8h
function name:  (null)
number of ops:  23
compiled vars:  !0 = $f, !1 = $x, !2 = $a, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $4      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   10     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        DO_FCALL                                      0  $7      
          5        ASSIGN                                                   !1, $7
   11     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   12     9        INIT_METHOD_CALL                                         !0, 'bar'
         10        DO_FCALL                                      0  $10     
         11        ASSIGN_REF                                               !2, $10
   13    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
   14    15        PRE_INC                                                  !2
   15    16        INIT_METHOD_CALL                                         !0, 'bar'
         17        DO_FCALL                                      0  $14     
         18        ASSIGN                                                   !3, $14
   16    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class foo:
Function __call:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/kgf8h
function name:  __call
number of ops:  6
compiled vars:  !0 = $foo, !1 = $bar, !2 = $cnt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        BIND_STATIC                                              !2
    5     3        PRE_INC                                                  !2
    6     4      > RETURN_BY_REF                                            !2
    7     5*     > RETURN_BY_REF                                            null

End of function __call

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.2 ms | 1388 KiB | 15 Q