3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class PluginClientFactory { private static $factory; public static function setFactory(callable $factory) { static::$factory = $factory; } public function createClient($client, array $plugins = [], array $options = []) { if (static::$factory) { return static::$factory($client, $plugins, $options); } return new PluginClient($client, $plugins, $options); } } PluginClientFactory::setFactory(function () {}); $factory = new PluginClientFactory(); $factory->createClient('client');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WA5ek
function name:  (null)
number of ops:  11
compiled vars:  !0 = $factory
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_STATIC_METHOD_CALL                                  'PluginClientFactory', 'setFactory'
          1        DECLARE_LAMBDA_FUNCTION                          ~1      [0]
          2        SEND_VAL                                                 ~1
          3        DO_FCALL                                      0          
   24     4        NEW                                              $3      'PluginClientFactory'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   25     7        INIT_METHOD_CALL                                         !0, 'createClient'
          8        SEND_VAL_EX                                              'client'
          9        DO_FCALL                                      0          
         10      > 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/WA5ek
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E > > RETURN                                                   null

End of Dynamic Function 0

Class PluginClientFactory:
Function setfactory:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WA5ek
function name:  setFactory
number of ops:  4
compiled vars:  !0 = $factory
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_STATIC_PROP                                       'factory'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function setfactory

Function createclient:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WA5ek
function name:  createClient
number of ops:  18
compiled vars:  !0 = $client, !1 = $plugins, !2 = $options, !3 = $factory
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
          2        RECV_INIT                                        !2      <array>
   14     3        FETCH_STATIC_PROP_R          unknown             ~4      'factory'
          4      > JMPZ                                                     ~4, ->11
   15     5    >   INIT_STATIC_METHOD_CALL                                  !3
          6        SEND_VAR_EX                                              !0
          7        SEND_VAR_EX                                              !1
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $5      
         10      > RETURN                                                   $5
   18    11    >   NEW                                              $6      'PluginClient'
         12        SEND_VAR_EX                                              !0
         13        SEND_VAR_EX                                              !1
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0          
         16      > RETURN                                                   $6
   19    17*     > RETURN                                                   null

End of function createclient

End of class PluginClientFactory.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.64 ms | 1004 KiB | 13 Q