3v4l.org

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

Class foo:
Function __call:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/Dr2lF
function name:  __call
number of ops:  8
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        FETCH_W                      static              $3      'cnt'
         3        ASSIGN_REF                                               !2, $3
   5     4        POST_INC                                         ~4      !2
         5        FREE                                                     ~4
   6     6      > RETURN_BY_REF                                            !2
   7     7*     > RETURN_BY_REF                                            null

End of function __call

End of class foo.

Generated using Vulcan Logic Dumper, using php 7.2.0