3v4l.org

run code in 500+ 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:/in/SqOPO:20}
number of ops:  6
compiled vars:  !0 = $datum
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   RECV                                                 !0      
          1        FRAMELESS_ICALL_1                trim                ~1      !0
          2        VERIFY_RETURN_TYPE                                           ~1
          3      > RETURN                                                       ~1
          4*       VERIFY_RETURN_TYPE                                           
          5*     > 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.5.0


preferences:
156.4 ms | 1451 KiB | 14 Q