3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface ValueAccessor { public function & accessValue($object, $memberName); } final class DemoFile implements ValueAccessor { public function & accessValue($object, $memberName) { return count($object); } } $acc = new DemoFile(); $array = [1,2,3]; echo $acc->accessValue($array, 'count');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f8GDO
function name:  (null)
number of ops:  11
compiled vars:  !0 = $acc, !1 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                                'demofile'
   15     1        NEW                                                  $2      'DemoFile'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
   16     4        ASSIGN                                                       !1, <array>
   17     5        INIT_METHOD_CALL                                             !0, 'accessValue'
          6        SEND_VAR_EX                                                  !1
          7        SEND_VAL_EX                                                  'count'
          8        DO_FCALL                                          0  $6      
          9        ECHO                                                         $6
         10      > RETURN                                                       1

Class ValueAccessor:
Function accessvalue:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/f8GDO
function name:  accessValue
number of ops:  3
compiled vars:  !0 = $object, !1 = $memberName
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2      > RETURN_BY_REF                                                null

End of function accessvalue

End of class ValueAccessor.

Class DemoFile:
Function accessvalue:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/f8GDO
function name:  accessValue
number of ops:  5
compiled vars:  !0 = $object, !1 = $memberName
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   11     2        COUNT                                                ~2      !0
          3      > RETURN_BY_REF                                                ~2
   12     4*     > RETURN_BY_REF                                                null

End of function accessvalue

End of class DemoFile.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.91 ms | 3330 KiB | 13 Q