3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public const INSERTTAG = null; public function getInsertTag(): string { if (null === static::INSERTTAG) { throw new \LogicException('Please add a public INSERTTAG constant in your insert tag class'); } return static::INSERTTAG; } } class B extends A { public const INSERTTAG = '{{foo::%s}}'; } class C extends A { } $b = new B(); var_dump($b->getInsertTag()); $c = new C(); var_dump($c->getInsertTag());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pRVpe
function name:  (null)
number of ops:  17
compiled vars:  !0 = $b, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $2      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   24     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'getInsertTag'
          5        DO_FCALL                                      0  $5      
          6        SEND_VAR                                                 $5
          7        DO_ICALL                                                 
   26     8        NEW                                              $7      'C'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $7
   27    11        INIT_FCALL                                               'var_dump'
         12        INIT_METHOD_CALL                                         !1, 'getInsertTag'
         13        DO_FCALL                                      0  $10     
         14        SEND_VAR                                                 $10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class A:
Function getinserttag:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pRVpe
function name:  getInsertTag
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_CLASS_CONSTANT                             ~0      'INSERTTAG'
          1        TYPE_CHECK                                    2          ~0
          2      > JMPZ                                                     ~1, ->7
    9     3    >   NEW                                              $2      'LogicException'
          4        SEND_VAL_EX                                              'Please+add+a+public+INSERTTAG+constant+in+your+insert+tag+class'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
   12     7    >   FETCH_CLASS_CONSTANT                             ~4      'INSERTTAG'
          8        VERIFY_RETURN_TYPE                                       ~4
          9      > RETURN                                                   ~4
   13    10*       VERIFY_RETURN_TYPE                                       
         11*     > RETURN                                                   null

End of function getinserttag

End of class A.

Class B:
Function getinserttag:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pRVpe
function name:  getInsertTag
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_CLASS_CONSTANT                             ~0      'INSERTTAG'
          1        TYPE_CHECK                                    2          ~0
          2      > JMPZ                                                     ~1, ->7
    9     3    >   NEW                                              $2      'LogicException'
          4        SEND_VAL_EX                                              'Please+add+a+public+INSERTTAG+constant+in+your+insert+tag+class'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
   12     7    >   FETCH_CLASS_CONSTANT                             ~4      'INSERTTAG'
          8        VERIFY_RETURN_TYPE                                       ~4
          9      > RETURN                                                   ~4
   13    10*       VERIFY_RETURN_TYPE                                       
         11*     > RETURN                                                   null

End of function getinserttag

End of class B.

Class C:
Function getinserttag:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pRVpe
function name:  getInsertTag
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_CLASS_CONSTANT                             ~0      'INSERTTAG'
          1        TYPE_CHECK                                    2          ~0
          2      > JMPZ                                                     ~1, ->7
    9     3    >   NEW                                              $2      'LogicException'
          4        SEND_VAL_EX                                              'Please+add+a+public+INSERTTAG+constant+in+your+insert+tag+class'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
   12     7    >   FETCH_CLASS_CONSTANT                             ~4      'INSERTTAG'
          8        VERIFY_RETURN_TYPE                                       ~4
          9      > RETURN                                                   ~4
   13    10*       VERIFY_RETURN_TYPE                                       
         11*     > RETURN                                                   null

End of function getinserttag

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.17 ms | 1405 KiB | 15 Q