3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace concrete5; interface AttributeInterface { /** * Attribute Handle */ public function renderedContent(); } /* ...... */ class MyCustomObject extends Model implements AttributeInterface { public function renderedContent() { return 'derp'; } } /* .... Register the attribute */ Attribute::registerAttribute('my_custom_attribute', function () { return new MyCustomObject; }); /* .... Show attribute */ class SomeRenderingClass { function renderAttribute(AttributeInterface $attribute) { return $attribute->renderedContent(); } function renderAttributes() { $attributes = Attribute::getAllAttributes(); $rendered = array(); foreach($attributes as $attribute) { $rendered[] = $this->renderAttribute($attribute); } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SHs9e
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   DECLARE_CLASS                                            'concrete5%5Cmycustomobject', 'concrete5%5Cmodel'
   29     1        INIT_STATIC_METHOD_CALL                                  'concrete5%5CAttribute', 'registerAttribute'
          2        SEND_VAL_EX                                              'my_custom_attribute'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00concrete5%5C%7Bclosure%7D%2Fin%2FSHs9e%3A29%241'
   31     4        SEND_VAL_EX                                              ~0
          5        DO_FCALL                                      0          
   52     6      > RETURN                                                   1

Function %00concrete5%5C%7Bclosure%7D%2Fin%2FSHs9e%3A29%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SHs9e
function name:  concrete5\{closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $0      'concrete5%5CMyCustomObject'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   31     3*     > RETURN                                                   null

End of function %00concrete5%5C%7Bclosure%7D%2Fin%2FSHs9e%3A29%241

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

End of function renderedcontent

End of class concrete5\AttributeInterface.

Class concrete5\MyCustomObject:
Function renderedcontent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SHs9e
function name:  renderedContent
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E > > RETURN                                                   'derp'
   21     1*     > RETURN                                                   null

End of function renderedcontent

End of class concrete5\MyCustomObject.

Class concrete5\SomeRenderingClass:
Function renderattribute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SHs9e
function name:  renderAttribute
number of ops:  5
compiled vars:  !0 = $attribute
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   RECV                                             !0      
   41     1        INIT_METHOD_CALL                                         !0, 'renderedContent'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   42     4*     > RETURN                                                   null

End of function renderattribute

Function renderattributes:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/SHs9e
function name:  renderAttributes
number of ops:  14
compiled vars:  !0 = $attributes, !1 = $rendered, !2 = $attribute
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   INIT_STATIC_METHOD_CALL                                  'concrete5%5CAttribute', 'getAllAttributes'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN                                                   !0, $3
   46     3        ASSIGN                                                   !1, <array>
   47     4      > FE_RESET_R                                       $6      !0, ->12
          5    > > FE_FETCH_R                                               $6, !2, ->12
   48     6    >   INIT_METHOD_CALL                                         'renderAttribute'
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0  $8      
          9        ASSIGN_DIM                                               !1
         10        OP_DATA                                                  $8
   47    11      > JMP                                                      ->5
         12    >   FE_FREE                                                  $6
   50    13      > RETURN                                                   null

End of function renderattributes

End of class concrete5\SomeRenderingClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.36 ms | 1399 KiB | 13 Q