3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SkipCallableParamAssignFluentMultiParams { private $transform; public function withTransform(callable $callable) { $this->transform = $callable; return $this; } public function run($value, $optionalData = []) { var_dump(($this->transform)($value, $optionalData)); } } (new SkipCallableParamAssignFluentMultiParams()) ->withTransform(fn (string $datum): string => trim($datum)) ->run(' some data ');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SqOPO
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $0      'SkipCallableParamAssignFluentMultiParams'
          1        DO_FCALL                                      0          
   20     2        INIT_METHOD_CALL                                         $0, 'withTransform'
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          4        SEND_VAL_EX                                              ~2
          5        DO_FCALL                                      0  $3      
   21     6        INIT_METHOD_CALL                                         $3, 'run'
          7        SEND_VAL_EX                                              '++some+data++'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SqOPO
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $datum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'trim'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
          6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of Dynamic Function 0

Class SkipCallableParamAssignFluentMultiParams:
Function withtransform:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SqOPO
function name:  withTransform
number of ops:  6
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'transform'
          2        OP_DATA                                                  !0
   10     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   11     5*     > RETURN                                                   null

End of function withtransform

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SqOPO
function name:  run
number of ops:  11
compiled vars:  !0 = $value, !1 = $optionalData
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
   15     2        INIT_FCALL                                               'var_dump'
          3        FETCH_OBJ_R                                      ~2      'transform'
          4        INIT_DYNAMIC_CALL                                        ~2
          5        SEND_VAR_EX                                              !0
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0  $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
   16    10      > RETURN                                                   null

End of function run

End of class SkipCallableParamAssignFluentMultiParams.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.04 ms | 1019 KiB | 15 Q