3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Result { private final function __construct() { } public static function success() { return new Success(); } public static function failure() { return new Failure(); } } final class Success extends Result { public static function fakeIt() { return new self(); } } final class Failure extends Result { } var_dump(Result::success()); var_dump(Failure::success()); Success::fakeIt();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QbJaF
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'Result', 'success'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
   32     5        INIT_FCALL                                               'var_dump'
          6        INIT_STATIC_METHOD_CALL                                  'Failure', 'success'
          7        DO_FCALL                                      0  $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
   34    10        INIT_STATIC_METHOD_CALL                                  'Success', 'fakeIt'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class Result:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QbJaF
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   null

End of function __construct

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

End of function success

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

End of function failure

End of class Result.

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

End of function fakeit

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

End of function __construct

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

End of function success

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

End of function failure

End of class Success.

Class Failure:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QbJaF
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   null

End of function __construct

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

End of function success

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

End of function failure

End of class Failure.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.34 ms | 1400 KiB | 15 Q