3v4l.org

run code in 200+ php & hhvm versions
<?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(Result::failure()); Success::fakeIt();
based on QbJaF
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5aK01
function name:  (null)
number of ops:  16
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  20     1        NOP                                                      
  25     2        NOP                                                      
  31     3        INIT_FCALL                                               'var_dump'
         4        INIT_STATIC_METHOD_CALL                                  'Result', 'success'
         5        DO_FCALL                                      0  $3      
         6        SEND_VAR                                                 $3
         7        DO_ICALL                                                 
  32     8        INIT_FCALL                                               'var_dump'
         9        INIT_STATIC_METHOD_CALL                                  'Result', 'failure'
        10        DO_FCALL                                      0  $5      
        11        SEND_VAR                                                 $5
        12        DO_ICALL                                                 
  34    13        INIT_STATIC_METHOD_CALL                                  'Success', 'fakeIt'
        14        DO_FCALL                                      0          
        15      > RETURN                                                   1

Class Result:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5aK01
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/5aK01
function name:  success
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  11     0  E >   NEW                                              $0      :3
         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/5aK01
function name:  failure
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  16     0  E >   NEW                                              $0      :3
         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/5aK01
function name:  fakeIt
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  22     0  E >   NEW                                              $0      :27
         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/5aK01
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/5aK01
function name:  success
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  11     0  E >   NEW                                              $0      :3
         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/5aK01
function name:  failure
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  16     0  E >   NEW                                              $0      :3
         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/5aK01
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/5aK01
function name:  success
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  11     0  E >   NEW                                              $0      :3
         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/5aK01
function name:  failure
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  16     0  E >   NEW                                              $0      :3
         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 7.3.0