3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getData() { return array('foo' => 42); } function a() { return eval('($data = getData(), $data["foo"])'); } function b() { return eval('getData()["foo"]'); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mGhHk
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   1

Function getdata:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mGhHk
function name:  getData
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > RETURN                                                   <array>
    4     1*     > RETURN                                                   null

End of function getdata

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mGhHk
function name:  a
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INCLUDE_OR_EVAL                                  $0      '%28%24data+%3D+getData%28%29%2C+%24data%5B%22foo%22%5D%29', EVAL
          1      > RETURN                                                   $0
    8     2*     > RETURN                                                   null

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mGhHk
function name:  b
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INCLUDE_OR_EVAL                                  $0      'getData%28%29%5B%22foo%22%5D', EVAL
          1      > RETURN                                                   $0
   12     2*     > RETURN                                                   null

End of function b

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.16 ms | 1394 KiB | 13 Q