3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo; class A { public function getFoo() { return 'foo'; } } $i = new A; $code = <<<EOF <?php \$a = new Foo\A; \$a->setFoo({$i->getFoo()}); EOF; var_dump($code);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rjd4Z
function name:  (null)
number of ops:  13
compiled vars:  !0 = $i, !1 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'Foo%5CA'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   13     3        ROPE_INIT                                     3  ~7      '%3C%3Fphp%0A%0A%24a+%3D+new+Foo%5CA%3B%0A%24a-%3EsetFoo%28'
   16     4        INIT_METHOD_CALL                                         !0, 'getFoo'
          5        DO_FCALL                                      0  $5      
          6        ROPE_ADD                                      1  ~7      ~7, $5
          7        ROPE_END                                      2  ~6      ~7, '%29%3B'
   12     8        ASSIGN                                                   !1, ~6
   19     9        INIT_NS_FCALL_BY_NAME                                    'Foo%5Cvar_dump'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class Foo\A:
Function getfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rjd4Z
function name:  getFoo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   'foo'
    9     1*     > RETURN                                                   null

End of function getfoo

End of class Foo\A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
194.9 ms | 1395 KiB | 15 Q