3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace SComparison; class Comparator { protected $_strings = array(); protected $_tests = array(); protected $_hash; public function __construct() { $this->_hash = new SHash(); } /** * converting input data */ protected function _prepareInput() { foreach ($this->_strings as $key => $string) { $this->_tests[$key] = str_replace(" ", "", strtolower($string)); } } protected function _outputInteractive($key) { echo "String: " . $this->_strings[$key] . "\n"; echo "Test: " . $this->_tests[$key] . "\n"; echo "Hash: " . $this->_hash->getHash(SHash::HASH_BIN) . " - " . $this->_hash->getHash() . "\n"; echo "-----------------------------------------------------------\n"; } /** * executing comparison action */ public function runInteractive() { $this->_prepareInput(); foreach ($this->_tests as $key => $test) { $this->_hash->setString($test); $this->_hash->getHash(); $this->_outputInteractive($key); } } public function runCL() { $this->_prepareInput(); foreach ($this->_tests as $key => $test) { $this->_hash->setString($test); $this->_hash->getHash(); $this->_outputInteractive($key); } } public function setStrings(array $strings) { $this->_strings = $strings; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aKjmm
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   64     0  E > > RETURN                                                   1

Class SComparison\Comparator:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aKjmm
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'SComparison%5CSHash'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               '_hash'
          3        OP_DATA                                                  $1
   13     4      > RETURN                                                   null

End of function __construct

Function _prepareinput:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 16
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/aKjmm
function name:  _prepareInput
number of ops:  18
compiled vars:  !0 = $string, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_OBJ_R                                      ~2      '_strings'
          1      > FE_RESET_R                                       $3      ~2, ->16
          2    > > FE_FETCH_R                                       ~4      $3, !0, ->16
          3    >   ASSIGN                                                   !1, ~4
   21     4        INIT_NS_FCALL_BY_NAME                                    'SComparison%5Cstr_replace'
          5        SEND_VAL_EX                                              '+'
          6        SEND_VAL_EX                                              ''
          7        INIT_NS_FCALL_BY_NAME                                    'SComparison%5Cstrtolower'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $8      
         10        SEND_VAR_NO_REF_EX                                       $8
         11        DO_FCALL                                      0  $9      
         12        FETCH_OBJ_W                                      $6      '_tests'
         13        ASSIGN_DIM                                               $6, !1
         14        OP_DATA                                                  $9
   20    15      > JMP                                                      ->2
         16    >   FE_FREE                                                  $3
   23    17      > RETURN                                                   null

End of function _prepareinput

Function _outputinteractive:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aKjmm
function name:  _outputInteractive
number of ops:  26
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   27     1        FETCH_OBJ_R                                      ~1      '_strings'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3        CONCAT                                           ~3      'String%3A+', ~2
          4        CONCAT                                           ~4      ~3, '%0A'
          5        ECHO                                                     ~4
   28     6        FETCH_OBJ_R                                      ~5      '_tests'
          7        FETCH_DIM_R                                      ~6      ~5, !0
          8        CONCAT                                           ~7      'Test%3A+++', ~6
          9        CONCAT                                           ~8      ~7, '%0A'
         10        ECHO                                                     ~8
   30    11        FETCH_OBJ_R                                      ~9      '_hash'
         12        INIT_METHOD_CALL                                         ~9, 'getHash'
         13        FETCH_CLASS_CONSTANT                             ~10     'SComparison%5CSHash', 'HASH_BIN'
         14        SEND_VAL_EX                                              ~10
         15        DO_FCALL                                      0  $11     
         16        CONCAT                                           ~12     'Hash%3A+++', $11
   31    17        CONCAT                                           ~13     ~12, '+-+'
   32    18        FETCH_OBJ_R                                      ~14     '_hash'
         19        INIT_METHOD_CALL                                         ~14, 'getHash'
         20        DO_FCALL                                      0  $15     
         21        CONCAT                                           ~16     ~13, $15
   33    22        CONCAT                                           ~17     ~16, '%0A'
         23        ECHO                                                     ~17
   34    24        ECHO                                                     '-----------------------------------------------------------%0A'
   35    25      > RETURN                                                   null

End of function _outputinteractive

Function runinteractive:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/aKjmm
function name:  runInteractive
number of ops:  19
compiled vars:  !0 = $test, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   INIT_METHOD_CALL                                         '_prepareInput'
          1        DO_FCALL                                      0          
   43     2        FETCH_OBJ_R                                      ~3      '_tests'
          3      > FE_RESET_R                                       $4      ~3, ->17
          4    > > FE_FETCH_R                                       ~5      $4, !0, ->17
          5    >   ASSIGN                                                   !1, ~5
   44     6        FETCH_OBJ_R                                      ~7      '_hash'
          7        INIT_METHOD_CALL                                         ~7, 'setString'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   45    10        FETCH_OBJ_R                                      ~9      '_hash'
         11        INIT_METHOD_CALL                                         ~9, 'getHash'
         12        DO_FCALL                                      0          
   46    13        INIT_METHOD_CALL                                         '_outputInteractive'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0          
   43    16      > JMP                                                      ->4
         17    >   FE_FREE                                                  $4
   48    18      > RETURN                                                   null

End of function runinteractive

Function runcl:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/aKjmm
function name:  runCL
number of ops:  19
compiled vars:  !0 = $test, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   INIT_METHOD_CALL                                         '_prepareInput'
          1        DO_FCALL                                      0          
   53     2        FETCH_OBJ_R                                      ~3      '_tests'
          3      > FE_RESET_R                                       $4      ~3, ->17
          4    > > FE_FETCH_R                                       ~5      $4, !0, ->17
          5    >   ASSIGN                                                   !1, ~5
   54     6        FETCH_OBJ_R                                      ~7      '_hash'
          7        INIT_METHOD_CALL                                         ~7, 'setString'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   55    10        FETCH_OBJ_R                                      ~9      '_hash'
         11        INIT_METHOD_CALL                                         ~9, 'getHash'
         12        DO_FCALL                                      0          
   56    13        INIT_METHOD_CALL                                         '_outputInteractive'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0          
   53    16      > JMP                                                      ->4
         17    >   FE_FREE                                                  $4
   58    18      > RETURN                                                   null

End of function runcl

Function setstrings:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aKjmm
function name:  setStrings
number of ops:  4
compiled vars:  !0 = $strings
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   60     0  E >   RECV                                             !0      
   62     1        ASSIGN_OBJ                                               '_strings'
          2        OP_DATA                                                  !0
   63     3      > RETURN                                                   null

End of function setstrings

End of class SComparison\Comparator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.19 ms | 1404 KiB | 17 Q