3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Astesia; class PrintableString { private $string; public function __construct() { $this->string = (string) NULL; } public function getCharCodeAt($index) { return ord(substr($this->string, $index, 1)); } public function mix( $begin, $secondString, $begin2, $end2 ) { $this->string = substr($this->string, 0, $begin) . substr($secondString->getInternal(), $begin2, $end2 - $begin2 + 1 ) . substr($this->string, $begin); } public function getInternal() { return $this->string; } public function setInternal($str) { $this->string = $str; } } $string1 = new \Astesia\PrintableString(); $string1->setInternal("ABC"); $string2 = new \Astesia\PrintableString(); $string2->setInternal("DEF"); $string1->mix(3,$string2,0,3); echo $string1->getInternal(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ARDSm
function name:  (null)
number of ops:  22
compiled vars:  !0 = $string1, !1 = $string2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $2      'Astesia%5CPrintableString'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   29     3        INIT_METHOD_CALL                                         !0, 'setInternal'
          4        SEND_VAL_EX                                              'ABC'
          5        DO_FCALL                                      0          
   31     6        NEW                                              $6      'Astesia%5CPrintableString'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   32     9        INIT_METHOD_CALL                                         !1, 'setInternal'
         10        SEND_VAL_EX                                              'DEF'
         11        DO_FCALL                                      0          
   34    12        INIT_METHOD_CALL                                         !0, 'mix'
         13        SEND_VAL_EX                                              3
         14        SEND_VAR_EX                                              !1
         15        SEND_VAL_EX                                              0
         16        SEND_VAL_EX                                              3
         17        DO_FCALL                                      0          
   36    18        INIT_METHOD_CALL                                         !0, 'getInternal'
         19        DO_FCALL                                      0  $11     
         20        ECHO                                                     $11
   39    21      > RETURN                                                   1

Class Astesia\PrintableString:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ARDSm
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   CAST                                          6  ~1      null
          1        ASSIGN_OBJ                                               'string'
          2        OP_DATA                                                  ~1
    8     3      > RETURN                                                   null

End of function __construct

Function getcharcodeat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ARDSm
function name:  getCharCodeAt
number of ops:  13
compiled vars:  !0 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_NS_FCALL_BY_NAME                                    'Astesia%5Cord'
          2        INIT_NS_FCALL_BY_NAME                                    'Astesia%5Csubstr'
          3        CHECK_FUNC_ARG                                           
          4        FETCH_OBJ_FUNC_ARG                               $1      'string'
          5        SEND_FUNC_ARG                                            $1
          6        SEND_VAR_EX                                              !0
          7        SEND_VAL_EX                                              1
          8        DO_FCALL                                      0  $2      
          9        SEND_VAR_NO_REF_EX                                       $2
         10        DO_FCALL                                      0  $3      
         11      > RETURN                                                   $3
   12    12*     > RETURN                                                   null

End of function getcharcodeat

Function mix:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ARDSm
function name:  mix
number of ops:  31
compiled vars:  !0 = $begin, !1 = $secondString, !2 = $begin2, !3 = $end2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   15     4        INIT_NS_FCALL_BY_NAME                                    'Astesia%5Csubstr'
          5        CHECK_FUNC_ARG                                           
          6        FETCH_OBJ_FUNC_ARG                               $5      'string'
          7        SEND_FUNC_ARG                                            $5
          8        SEND_VAL_EX                                              0
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $6      
         11        INIT_NS_FCALL_BY_NAME                                    'Astesia%5Csubstr'
         12        INIT_METHOD_CALL                                         !1, 'getInternal'
         13        DO_FCALL                                      0  $7      
         14        SEND_VAR_NO_REF_EX                                       $7
         15        SEND_VAR_EX                                              !2
         16        SUB                                              ~8      !3, !2
         17        ADD                                              ~9      ~8, 1
         18        SEND_VAL_EX                                              ~9
         19        DO_FCALL                                      0  $10     
         20        CONCAT                                           ~11     $6, $10
         21        INIT_NS_FCALL_BY_NAME                                    'Astesia%5Csubstr'
         22        CHECK_FUNC_ARG                                           
         23        FETCH_OBJ_FUNC_ARG                               $12     'string'
         24        SEND_FUNC_ARG                                            $12
         25        SEND_VAR_EX                                              !0
         26        DO_FCALL                                      0  $13     
         27        CONCAT                                           ~14     ~11, $13
         28        ASSIGN_OBJ                                               'string'
         29        OP_DATA                                                  ~14
   16    30      > RETURN                                                   null

End of function mix

Function getinternal:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ARDSm
function name:  getInternal
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~0      'string'
          1      > RETURN                                                   ~0
   20     2*     > RETURN                                                   null

End of function getinternal

Function setinternal:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ARDSm
function name:  setInternal
number of ops:  4
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   23     1        ASSIGN_OBJ                                               'string'
          2        OP_DATA                                                  !0
   24     3      > RETURN                                                   null

End of function setinternal

End of class Astesia\PrintableString.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
232.14 ms | 1404 KiB | 17 Q