3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<EOD Example of string spanning multiple lines using heredoc syntax. EOD; /* More complex example, with variables. */ class foo { var $foo; var $bar; function foo() { $this->foo = 'Foo'; $this->bar = array('Bar1', 'Bar2', 'Bar3'); } } $foo = new foo(); $name = 'MyName'; function printss(){ echo <<<EOT My name is "$name". I am printing some $foo->foo. Now, I am printing some {$foo->bar[1]}. This should print a capital 'A': \x41 EOT; } function main(){ $idx = 100; while($idx){ $idx--; printss(); } } main(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cpgSd
function name:  (null)
number of ops:  8
compiled vars:  !0 = $str, !1 = $foo, !2 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'Example+of+string%0Aspanning+multiple+lines%0Ausing+heredoc+syntax.'
   23     1        NEW                                              $4      'foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   24     4        ASSIGN                                                   !2, 'MyName'
   41     5        INIT_FCALL                                               'main'
          6        DO_FCALL                                      0          
   42     7      > RETURN                                                   1

Function printss:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cpgSd
function name:  printss
number of ops:  12
compiled vars:  !0 = $name, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   ROPE_INIT                                     7  ~6      'My+name+is+%22'
          1        ROPE_ADD                                      1  ~6      ~6, !0
          2        ROPE_ADD                                      2  ~6      ~6, '%22.+I+am+printing+some+'
          3        FETCH_OBJ_R                                      ~2      !1, 'foo'
          4        ROPE_ADD                                      3  ~6      ~6, ~2
          5        ROPE_ADD                                      4  ~6      ~6, '.%0ANow%2C+I+am+printing+some+'
   29     6        FETCH_OBJ_R                                      ~3      !1, 'bar'
          7        FETCH_DIM_R                                      ~4      ~3, 1
          8        ROPE_ADD                                      5  ~6      ~6, ~4
          9        ROPE_END                                      6  ~5      ~6, '.%0AThis+should+print+a+capital+%27A%27%3A+A'
         10        ECHO                                                     ~5
   32    11      > RETURN                                                   null

End of function printss

Function main:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 2
Branch analysis from position: 6
Branch analysis from position: 2
filename:       /in/cpgSd
function name:  main
number of ops:  7
compiled vars:  !0 = $idx
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   ASSIGN                                                   !0, 100
   36     1      > JMP                                                      ->5
   37     2    >   PRE_DEC                                                  !0
   38     3        INIT_FCALL                                               'printss'
          4        DO_FCALL                                      0          
   36     5    > > JMPNZ                                                    !0, ->2
   40     6    > > RETURN                                                   null

End of function main

Class foo:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cpgSd
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN_OBJ                                               'foo'
          1        OP_DATA                                                  'Foo'
   19     2        ASSIGN_OBJ                                               'bar'
          3        OP_DATA                                                  <array>
   20     4      > RETURN                                                   null

End of function foo

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.85 ms | 1403 KiB | 15 Q