3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); interface Hydrator { public function hydrate($incoming, $model) : string; } interface ContextualHydratorExtension extends Hydrator { public function hydrate($incoming, $model, $context = null) : string; } interface ContextualHydrator { public function hydrateWithContext($incoming, $model, $context = null) : string; } class PlsContextHydrator implements Hydrator, ContextualHydratorExtension, ContextualHydrator { public function hydrate($incoming, $model, $context = null) : string { $args_format = rtrim(str_repeat('\'%s\', ', func_num_args()), ', '); $args_formatted = sprintf($args_format, ...func_get_args()); return sprintf("%s(%s)", __METHOD__, $args_formatted); } public function hydrateWithContext($incoming, $model, $context = null) : string { return $this->hydrate($incoming, $model, $context); } } $hydrator = new PlsContextHydrator(); var_dump( $hydrator->hydrate('nah', 'maybes', 'whatever') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYjX6
function name:  (null)
number of ops:  14
compiled vars:  !0 = $hydrator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'contextualhydratorextension'
   19     1        DECLARE_CLASS                                            'plscontexthydrator'
   35     2        NEW                                              $1      'PlsContextHydrator'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   37     5        INIT_FCALL                                               'var_dump'
   38     6        INIT_METHOD_CALL                                         !0, 'hydrate'
          7        SEND_VAL_EX                                              'nah'
          8        SEND_VAL_EX                                              'maybes'
          9        SEND_VAL_EX                                              'whatever'
         10        DO_FCALL                                      0  $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                                 
   39    13      > RETURN                                                   1

Class Hydrator:
Function hydrate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYjX6
function name:  hydrate
number of ops:  4
compiled vars:  !0 = $incoming, !1 = $model
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        VERIFY_RETURN_TYPE                                       
          3      > RETURN                                                   null

End of function hydrate

End of class Hydrator.

Class ContextualHydratorExtension:
Function hydrate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYjX6
function name:  hydrate
number of ops:  5
compiled vars:  !0 = $incoming, !1 = $model, !2 = $context
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
          3        VERIFY_RETURN_TYPE                                       
          4      > RETURN                                                   null

End of function hydrate

End of class ContextualHydratorExtension.

Class ContextualHydrator:
Function hydratewithcontext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYjX6
function name:  hydrateWithContext
number of ops:  5
compiled vars:  !0 = $incoming, !1 = $model, !2 = $context
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
          3        VERIFY_RETURN_TYPE                                       
          4      > RETURN                                                   null

End of function hydratewithcontext

End of class ContextualHydrator.

Class PlsContextHydrator:
Function hydrate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYjX6
function name:  hydrate
number of ops:  29
compiled vars:  !0 = $incoming, !1 = $model, !2 = $context, !3 = $args_format, !4 = $args_formatted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
   23     3        INIT_FCALL                                               'rtrim'
          4        INIT_FCALL                                               'str_repeat'
          5        SEND_VAL                                                 '%27%25s%27%2C+'
          6        FUNC_NUM_ARGS                                    ~5      
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                         $6      
          9        SEND_VAR                                                 $6
         10        SEND_VAL                                                 '%2C+'
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !3, $7
   24    13        INIT_FCALL                                               'sprintf'
         14        SEND_VAR                                                 !3
         15        FUNC_GET_ARGS                                    ~9      
         16        SEND_UNPACK                                              ~9
         17        CHECK_UNDEF_ARGS                                         
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !4, $10
   26    20        INIT_FCALL                                               'sprintf'
         21        SEND_VAL                                                 '%25s%28%25s%29'
         22        SEND_VAL                                                 'PlsContextHydrator%3A%3Ahydrate'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                         $12     
         25        VERIFY_RETURN_TYPE                                       $12
         26      > RETURN                                                   $12
   27    27*       VERIFY_RETURN_TYPE                                       
         28*     > RETURN                                                   null

End of function hydrate

Function hydratewithcontext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYjX6
function name:  hydrateWithContext
number of ops:  12
compiled vars:  !0 = $incoming, !1 = $model, !2 = $context
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
   31     3        INIT_METHOD_CALL                                         'hydrate'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        SEND_VAR_EX                                              !2
          7        DO_FCALL                                      0  $3      
          8        VERIFY_RETURN_TYPE                                       $3
          9      > RETURN                                                   $3
   32    10*       VERIFY_RETURN_TYPE                                       
         11*     > RETURN                                                   null

End of function hydratewithcontext

End of class PlsContextHydrator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.65 ms | 1404 KiB | 21 Q