3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Trigger { var $me='hello'; function __construct() { $b = Expected::kill(); echo "\n==LINE8_VARDUMP==\n"; var_dump($b); return $b; } } class Expected { var $killerMessage=null; function __construct() { $this->killerMessage = 'Oops!'; return $this; } static function kill() { return new Expected; } } $obj = new Trigger; echo "\n==LINE21_VARDUMP==\n"; var_dump($obj); //-------------------------------------- //Current Output: //==LINE8_VARDUMP== //object(Expected)#2 (1) { // ["killerMessage"]=> // string(5) "Oops!" //} // //==LINE21_VARDUMP== //object(Trigger)#1 (1) { // ["me"]=> // string(5) "hello" //} // //Expected Output: //Both VARDUMP //object(Expected)#2 (1) { // ["killerMessage"]=> // string(5) "Oops!" //} ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q57RF
function name:  (null)
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Trigger'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        ECHO                                                     '%0A%3D%3DLINE21_VARDUMP%3D%3D%0A'
   22     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   50     7      > RETURN                                                   1

Class Trigger:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q57RF
function name:  __construct
number of ops:  9
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_STATIC_METHOD_CALL                                  'Expected', 'kill'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    8     3        ECHO                                                     '%0A%3D%3DLINE8_VARDUMP%3D%3D%0A'
    9     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   10     7      > RETURN                                                   !0
   11     8*     > RETURN                                                   null

End of function __construct

End of class Trigger.

Class Expected:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q57RF
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN_OBJ                                               'killerMessage'
          1        OP_DATA                                                  'Oops%21'
          2        FETCH_THIS                                       ~1      
          3      > RETURN                                                   ~1
          4*     > RETURN                                                   null

End of function __construct

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

End of function kill

End of class Expected.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.94 ms | 1396 KiB | 15 Q