3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooClass { public $string = 'this is some string'; } function getObject() { return new FooClass; } echo getObject()->string; $something = getObject(); echo $something->string;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0arHR
function name:  (null)
number of ops:  10
compiled vars:  !0 = $something
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'getobject'
          1        DO_FCALL                                      0  $1      
          2        FETCH_OBJ_R                                      ~2      $1, 'string'
          3        ECHO                                                     ~2
   15     4        INIT_FCALL                                               'getobject'
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !0, $3
   17     7        FETCH_OBJ_R                                      ~5      !0, 'string'
          8        ECHO                                                     ~5
          9      > RETURN                                                   1

Function getobject:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0arHR
function name:  getObject
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $0      'FooClass'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   11     3*     > RETURN                                                   null

End of function getobject

Class FooClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.97 ms | 1397 KiB | 15 Q