3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $x = "success"; } $a = new Test; ($_ = function () { echo $this->x."\n"; })->call($a); // Valid, but "Expected: semicolon" (function () { echo $this->x."\n"; })->call($a); // Valid, but "Expected: semicolon" // function () { echo $this->x."\n"; }->call($a); // PHP Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR)
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9p9kg
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $_
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   10     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F9p9kg%3A10%240'
          4        ASSIGN                                           ~6      !1, ~5
          5        INIT_METHOD_CALL                                         ~6, 'call'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
   11     8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F9p9kg%3A11%241'
          9        INIT_METHOD_CALL                                         ~8, 'call'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
   12    12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F9p9kg%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9p9kg
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'x'
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F9p9kg%3A10%240

Function %00%7Bclosure%7D%2Fin%2F9p9kg%3A11%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9p9kg
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'x'
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F9p9kg%3A11%241

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.61 ms | 1395 KiB | 13 Q