3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * The basic registry interface. * * @author Time.ly Network, Inc. * @since 2.0 * @package Ai1EC * @subpackage Ai1EC.Object */ interface Ai1ec_Registry { /** * Retrieves the key from the registry * * @param string $key * * @return mixed the value associated to the key. */ public function get( $key ); /** * Set the key into the registry. * * @param string $key * @param mixed $value */ public function set( $key, $value ); } /** * Application Registry: handles application wide variables. * * @author Time.ly Network, Inc. * @since 2.0 * @package Ai1EC * @subpackage Ai1EC.Object */ class Ai1ec_Registry_Application implements Ai1ec_Registry { /** * @var Ai1ec_Registry_Object */ protected $_registry; /** * @var array */ protected $_environment = array(); /** * The contructor method. * * @param Ai1ec_Registry_Object $registry */ function __construct( Ai1ec_Registry_Object $registry ) { $this->_registry = $registry; } /* (non-PHPdoc) * @see Ai1ec_Registry::get() */ public function get( $key ) { if ( ! isset ( $this->_environment[$key] ) ) { return false; } return $this->_environment[$key]; } /* (non-PHPdoc) * @see Ai1ec_Registry::set() */ public function set( $key, $value ) { $this->_environment[$key] = $value; } } $app = new Ai1ec_Registry_Application(); $app->set( 'foo', 'baz' ); echo $app->get( 'foo' );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cYo3V
function name:  (null)
number of ops:  13
compiled vars:  !0 = $app
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   DECLARE_CLASS                                            'ai1ec_registry_application'
   77     1        NEW                                              $1      'Ai1ec_Registry_Application'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   78     4        INIT_METHOD_CALL                                         !0, 'set'
          5        SEND_VAL_EX                                              'foo'
          6        SEND_VAL_EX                                              'baz'
          7        DO_FCALL                                      0          
   79     8        INIT_METHOD_CALL                                         !0, 'get'
          9        SEND_VAL_EX                                              'foo'
         10        DO_FCALL                                      0  $5      
         11        ECHO                                                     $5
         12      > RETURN                                                   1

Class Ai1ec_Registry:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cYo3V
function name:  get
number of ops:  2
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function get

Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cYo3V
function name:  set
number of ops:  3
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   null

End of function set

End of class Ai1ec_Registry.

Class Ai1ec_Registry_Application:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cYo3V
function name:  __construct
number of ops:  4
compiled vars:  !0 = $registry
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   RECV                                             !0      
   56     1        ASSIGN_OBJ                                               '_registry'
          2        OP_DATA                                                  !0
   57     3      > RETURN                                                   null

End of function __construct

Function get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cYo3V
function name:  get
number of ops:  10
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   RECV                                             !0      
   63     1        FETCH_OBJ_IS                                     ~1      '_environment'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~1, !0
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->6
   64     5    > > RETURN                                                   <false>
   66     6    >   FETCH_OBJ_R                                      ~4      '_environment'
          7        FETCH_DIM_R                                      ~5      ~4, !0
          8      > RETURN                                                   ~5
   67     9*     > RETURN                                                   null

End of function get

Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cYo3V
function name:  set
number of ops:  6
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   72     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   73     2        FETCH_OBJ_W                                      $2      '_environment'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
   74     5      > RETURN                                                   null

End of function set

End of class Ai1ec_Registry_Application.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.76 ms | 1399 KiB | 13 Q