3v4l.org

run code in 500+ PHP versions simultaneously
<?php class parent1 { public function __construct($param) { var_dump($param); } } class child extends parent1 { public function method() { //而且我在这里直接return居然不生效,代码直接从 //parent::__construct($param);开始执行,也就是说前面的代码没有执行,问题应该就在这里,不理解为什么不执行。 $param = 123; parent::__construct($param); } } (new child(1))->method();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6dj9W
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   NEW                                                  $0      'child'
          1        SEND_VAL_EX                                                  1
          2        DO_FCALL                                          0          
          3        INIT_METHOD_CALL                                             $0, 'method'
          4        DO_FCALL                                          0          
          5      > RETURN                                                       1

Class parent1:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6dj9W
function name:  __construct
number of ops:  5
compiled vars:  !0 = $param
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    7     1        INIT_FCALL                                                   'var_dump'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                                     
    8     4      > RETURN                                                       null

End of function __construct

End of class parent1.

Class child:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6dj9W
function name:  method
number of ops:  5
compiled vars:  !0 = $param
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                       !0, 123
   18     1        INIT_STATIC_METHOD_CALL                                      
          2        SEND_VAR_EX                                                  !0
          3        DO_FCALL                                          0          
   19     4      > RETURN                                                       null

End of function method

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6dj9W
function name:  __construct
number of ops:  5
compiled vars:  !0 = $param
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    7     1        INIT_FCALL                                                   'var_dump'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                                     
    8     4      > RETURN                                                       null

End of function __construct

End of class child.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
197.36 ms | 1709 KiB | 14 Q