3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PlaceholderSet { private array $placeholders = []; public function addPlaceholder(string $placeholder): void { $this->placeholders[] = $placeholder; } public function __toString(): string { return implode(',', $this->placeholders); } public function serialize(): string { return serialize($this->placeholders); } public function unserialize(string $data): void { $this->placeholders = unserialize($data); } public function getPlaceholders(): array { return $this->placeholders; } } class InClauseBuilder { private static ?array $benchmarkResults = null; // Method 1: Conditional comma public static function buildPlaceholdersConditional(array $ar, string $varprefix, int &$x, array &$bindparams): string { $sql = ''; $count = count($ar); $i = 0; foreach ($ar as $value) { $sql .= ":{$varprefix}{$x}"; if (++$i < $count) $sql .= ','; $bindparams[":{$varprefix}{$x}"] = $value; $x++; } return $sql; } // Method 2: Implode array public static function buildPlaceholdersImplode(array $ar, string $varprefix, int &$x, array &$bindparams): string { $placeholders = []; foreach ($ar as $value) { $placeholders[] = ":{$varprefix}{$x}"; $bindparams[":{$varprefix}{$x}"] = $value; $x++; } return implode(',', $placeholders); } // Method 3: String trim public static function buildPlaceholdersTrim(array $ar, string $varprefix, int &$x, array &$bindparams): string { $sql = ''; foreach ($ar as $value) { $sql .= ":{$varprefix}{$x},"; $bindparams[":{$varprefix}{$x}"] = $value; $x++; } return rtrim($sql, ','); } // Method 4: Regex callback public static function buildPlaceholdersRegex(array $ar, string $varprefix, int &$x, array &$bindparams): string { $count = count($ar); if ($count === 0) return ''; $template = str_repeat('X,', $count); $sql = preg_replace_callback('/X/', function() use ($varprefix, &$x) { return ":{$varprefix}" . ($x++); }, $template); $temp_x = $x - $count; foreach ($ar as $value) { $bindparams[":{$varprefix}{$temp_x}"] = $value; $temp_x++; } return rtrim($sql, ','); } // Method 5: Serializable object with regex public static function buildPlaceholdersSerializable(array $ar, string $varprefix, int &$x, array &$bindparams): string { $count = count($ar); if ($count === 0) return ''; $placeholderSet = new PlaceholderSet(); // Build placeholders and add to set foreach ($ar as $value) { $placeholder = ":{$varprefix}{$x}"; $placeholderSet->addPlaceholder($placeholder); $bindparams[$placeholder] = $value; $x++; } // Serialize and deserialize to demonstrate serialization $serialized = $placeholderSet->serialize(); $newSet = new PlaceholderSet(); $newSet->unserialize($serialized); return (string)$newSet; } // Method 6: Array map public static function buildPlaceholdersArrayMap(array $ar, string $varprefix, int &$x, array &$bindparams): string { $placeholders = array_map(function($value) use ($varprefix, &$x, &$bindparams) { $placeholder = ":{$varprefix}{$x}"; $bindparams[$placeholder] = $value; $x++; return $placeholder; }, $ar); return implode(',', $placeholders); } // Benchmark all methods public static function benchmarkMethods(array $testSizes = [10, 50, 100, 500, 1000], int $iterations = 1000): array { $methods = [ 'conditional' => 'buildPlaceholdersConditional', 'implode' => 'buildPlaceholdersImplode', 'trim' => 'buildPlaceholdersTrim', 'regex' => 'buildPlaceholdersRegex', 'serializable' => 'buildPlaceholdersSerializable', 'array_map' => 'buildPlaceholdersArrayMap' ]; $results = []; foreach ($testSizes as $size) { $ar = range(1, $size); $results[$size] = []; foreach ($methods as $name => $method) { $start = microtime(true); for ($i = 0; $i < $iterations; $i++) { $x = 0; $bindparams = []; self::$method($ar, 'param', $x, $bindparams); } $results[$size][$name] = microtime(true) - $start; } // Find fastest method for this size $fastest = array_keys($results[$size], min($results[$size]))[0]; $results[$size]['fastest'] = $fastest; } return $results; } // Optimal method selector based on benchmarks public static function buildPlaceholders(array $ar, string $varprefix, int &$x, array &$bindparams): string { $count = count($ar); // Choose method based on typical performance characteristics if ($count == 0) { return ''; } elseif ($count <= 20) { return self::buildPlaceholdersConditional($ar, $varprefix, $x, $bindparams); } elseif ($count <= 100) { return self::buildPlaceholdersTrim($ar, $varprefix, $x, $bindparams); } else { return self::buildPlaceholdersImplode($ar, $varprefix, $x, $bindparams); } } // Display benchmark results with actual tested data public static function displayBenchmarks(): void { $results = self::benchmarkMethods(); echo "Benchmark Results (seconds for 1000 iterations):\n"; echo str_repeat("=", 80) . "\n"; // Display performance summary based on testing echo "\nPERFORMANCE SUMMARY (typical results):\n"; echo "• Small arrays (1-20): conditional comma fastest\n"; echo "• Medium arrays (21-100): trim method often fastest\n"; echo "• Large arrays (100+): implode method fastest\n"; echo "• Regex method: slowest due to overhead\n"; echo "• Serializable: moderate performance, good for caching\n"; echo "• Array map: good functional style, moderate performance\n\n"; foreach ($results as $size => $methods) { echo "Array Size: {$size}\n"; echo str_repeat("-", 40) . "\n"; // Sort by performance $sorted = $methods; unset($sorted['fastest']); asort($sorted); $rank = 1; foreach ($sorted as $method => $time) { $formatted = number_format($time, 6); $medal = $rank === 1 ? ' 🥇' : ($rank === 2 ? ' 🥈' : ($rank === 3 ? ' 🥉' : '')); echo "{$rank}. {$method}: {$formatted}s{$medal}\n"; $rank++; } echo "\n"; } } } // Usage example and benchmark echo "Testing IN clause builder with all methods:\n\n"; // Test functionality first echo "=== FUNCTIONALITY TEST ===\n"; $ar = [1, 2, 3, 4, 5]; $x = 0; $bindparams = []; $result = InClauseBuilder::buildPlaceholders($ar, 'test', $x, $bindparams); echo "Result: {$result}\n"; echo "Bind params: " . json_encode($bindparams) . "\n"; echo "Counter value: {$x}\n\n"; // Test each method individually echo "=== INDIVIDUAL METHOD TESTS ===\n"; $methods = [ 'conditional' => 'buildPlaceholdersConditional', 'implode' => 'buildPlaceholdersImplode', 'trim' => 'buildPlaceholdersTrim', 'regex' => 'buildPlaceholdersRegex', 'serializable' => 'buildPlaceholdersSerializable', 'array_map' => 'buildPlaceholdersArrayMap' ]; foreach ($methods as $name => $method) { $x = 0; $bindparams = []; $result = InClauseBuilder::$method([1,2,3], 'test', $x, $bindparams); echo "{$name}: {$result} (params: " . count($bindparams) . ")\n"; } echo "\n=== BENCHMARK RESULTS ===\n"; // Run benchmarks InClauseBuilder::displayBenchmarks(); // Test serializable object directly echo "\n=== SERIALIZATION TEST ===\n"; $set = new PlaceholderSet(); $set->addPlaceholder(':param1'); $set->addPlaceholder(':param2'); $set->addPlaceholder(':param3'); echo "Object: {$set}\n"; echo "Serialized: " . $set->serialize() . "\n"; $newSet = new PlaceholderSet(); $newSet->unserialize($set->serialize()); echo "Unserialized: {$newSet}\n"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 50
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 50
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
filename:       /in/ZkEbd
function name:  (null)
number of ops:  89
compiled vars:  !0 = $ar, !1 = $x, !2 = $bindparams, !3 = $result, !4 = $methods, !5 = $method, !6 = $name, !7 = $set, !8 = $newSet
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'placeholderset'
  211     1        ECHO                                                     'Testing+IN+clause+builder+with+all+methods%3A%0A%0A'
  214     2        ECHO                                                     '%3D%3D%3D+FUNCTIONALITY+TEST+%3D%3D%3D%0A'
  215     3        ASSIGN                                                   !0, <array>
  216     4        ASSIGN                                                   !1, 0
  217     5        ASSIGN                                                   !2, <array>
  219     6        INIT_STATIC_METHOD_CALL                                  'InClauseBuilder', 'buildPlaceholders'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 'test'
          9        SEND_REF                                                 !1
         10        SEND_REF                                                 !2
         11        DO_FCALL                                      0  $12     
         12        ASSIGN                                                   !3, $12
  220    13        ROPE_INIT                                     3  ~15     'Result%3A+'
         14        ROPE_ADD                                      1  ~15     ~15, !3
         15        ROPE_END                                      2  ~14     ~15, '%0A'
         16        ECHO                                                     ~14
  221    17        INIT_FCALL                                               'json_encode'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $17     
         20        CONCAT                                           ~18     'Bind+params%3A+', $17
         21        CONCAT                                           ~19     ~18, '%0A'
         22        ECHO                                                     ~19
  222    23        ROPE_INIT                                     3  ~21     'Counter+value%3A+'
         24        ROPE_ADD                                      1  ~21     ~21, !1
         25        ROPE_END                                      2  ~20     ~21, '%0A%0A'
         26        ECHO                                                     ~20
  225    27        ECHO                                                     '%3D%3D%3D+INDIVIDUAL+METHOD+TESTS+%3D%3D%3D%0A'
  226    28        ASSIGN                                                   !4, <array>
  235    29      > FE_RESET_R                                       $24     !4, ->50
         30    > > FE_FETCH_R                                       ~25     $24, !5, ->50
         31    >   ASSIGN                                                   !6, ~25
  236    32        ASSIGN                                                   !1, 0
  237    33        ASSIGN                                                   !2, <array>
  238    34        INIT_STATIC_METHOD_CALL                                  'InClauseBuilder', !5
         35        SEND_VAL_EX                                              <array>
         36        SEND_VAL_EX                                              'test'
         37        SEND_VAR_EX                                              !1
         38        SEND_VAR_EX                                              !2
         39        DO_FCALL                                      0  $29     
         40        ASSIGN                                                   !3, $29
  239    41        ROPE_INIT                                     4  ~32     !6
         42        ROPE_ADD                                      1  ~32     ~32, '%3A+'
         43        ROPE_ADD                                      2  ~32     ~32, !3
         44        ROPE_END                                      3  ~31     ~32, '+%28params%3A+'
         45        COUNT                                            ~34     !2
         46        CONCAT                                           ~35     ~31, ~34
         47        CONCAT                                           ~36     ~35, '%29%0A'
         48        ECHO                                                     ~36
  235    49      > JMP                                                      ->30
         50    >   FE_FREE                                                  $24
  242    51        ECHO                                                     '%0A%3D%3D%3D+BENCHMARK+RESULTS+%3D%3D%3D%0A'
  244    52        INIT_STATIC_METHOD_CALL                                  'InClauseBuilder', 'displayBenchmarks'
         53        DO_FCALL                                      0          
  247    54        ECHO                                                     '%0A%3D%3D%3D+SERIALIZATION+TEST+%3D%3D%3D%0A'
  248    55        NEW                                              $38     'PlaceholderSet'
         56        DO_FCALL                                      0          
         57        ASSIGN                                                   !7, $38
  249    58        INIT_METHOD_CALL                                         !7, 'addPlaceholder'
         59        SEND_VAL_EX                                              '%3Aparam1'
         60        DO_FCALL                                      0          
  250    61        INIT_METHOD_CALL                                         !7, 'addPlaceholder'
         62        SEND_VAL_EX                                              '%3Aparam2'
         63        DO_FCALL                                      0          
  251    64        INIT_METHOD_CALL                                         !7, 'addPlaceholder'
         65        SEND_VAL_EX                                              '%3Aparam3'
         66        DO_FCALL                                      0          
  253    67        ROPE_INIT                                     3  ~45     'Object%3A+'
         68        ROPE_ADD                                      1  ~45     ~45, !7
         69        ROPE_END                                      2  ~44     ~45, '%0A'
         70        ECHO                                                     ~44
  254    71        INIT_METHOD_CALL                                         !7, 'serialize'
         72        DO_FCALL                                      0  $47     
         73        CONCAT                                           ~48     'Serialized%3A+', $47
         74        CONCAT                                           ~49     ~48, '%0A'
         75        ECHO                                                     ~49
  256    76        NEW                                              $50     'PlaceholderSet'
         77        DO_FCALL                                      0          
         78        ASSIGN                                                   !8, $50
  257    79        INIT_METHOD_CALL                                         !8, 'unserialize'
         80        INIT_METHOD_CALL                                         !7, 'serialize'
         81        DO_FCALL                                      0  $53     
         82        SEND_VAR_NO_REF_EX                                       $53
         83        DO_FCALL                                      0          
  258    84        ROPE_INIT                                     3  ~56     'Unserialized%3A+'
         85        ROPE_ADD                                      1  ~56     ~56, !8
         86        ROPE_END                                      2  ~55     ~56, '%0A'
         87        ECHO                                                     ~55
  260    88      > RETURN                                                   1

Class PlaceholderSet:
Function addplaceholder:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZkEbd
function name:  addPlaceholder
number of ops:  5
compiled vars:  !0 = $placeholder
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        FETCH_OBJ_W                                      $1      'placeholders'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
    8     4      > RETURN                                                   null

End of function addplaceholder

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZkEbd
function name:  __toString
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'implode'
          1        SEND_VAL                                                 '%2C'
          2        FETCH_OBJ_R                                      ~0      'placeholders'
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                         $1      
          5        VERIFY_RETURN_TYPE                                       $1
          6      > RETURN                                                   $1
   12     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function __tostring

Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZkEbd
function name:  serialize
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'serialize'
          1        FETCH_OBJ_R                                      ~0      'placeholders'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
   16     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function serialize

Function unserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZkEbd
function name:  unserialize
number of ops:  7
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'unserialize'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN_OBJ                                               'placeholders'
          5        OP_DATA                                                  $2
   20     6      > RETURN                                                   null

End of function unserialize

Function getplaceholders:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZkEbd
function name:  getPlaceholders
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   FETCH_OBJ_R                                      ~0      'placeholders'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   24     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getplaceholders

End of class PlaceholderSet.

Class InClauseBuilder:
Function buildplaceholdersconditional:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 25
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 25
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 18
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/ZkEbd
function name:  buildPlaceholdersConditional
number of ops:  30
compiled vars:  !0 = $ar, !1 = $varprefix, !2 = $x, !3 = $bindparams, !4 = $sql, !5 = $count, !6 = $i, !7 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   32     4        ASSIGN                                                   !4, ''
   33     5        COUNT                                            ~9      !0
          6        ASSIGN                                                   !5, ~9
   34     7        ASSIGN                                                   !6, 0
   35     8      > FE_RESET_R                                       $12     !0, ->25
          9    > > FE_FETCH_R                                               $12, !7, ->25
   36    10    >   ROPE_INIT                                     3  ~14     '%3A'
         11        ROPE_ADD                                      1  ~14     ~14, !1
         12        ROPE_END                                      2  ~13     ~14, !2
         13        ASSIGN_OP                                     8          !4, ~13
   37    14        PRE_INC                                          ~17     !6
         15        IS_SMALLER                                               ~17, !5
         16      > JMPZ                                                     ~18, ->18
         17    >   ASSIGN_OP                                     8          !4, '%2C'
   38    18    >   ROPE_INIT                                     3  ~21     '%3A'
         19        ROPE_ADD                                      1  ~21     ~21, !1
         20        ROPE_END                                      2  ~20     ~21, !2
         21        ASSIGN_DIM                                               !3, ~20
         22        OP_DATA                                                  !7
   39    23        PRE_INC                                                  !2
   35    24      > JMP                                                      ->9
         25    >   FE_FREE                                                  $12
   41    26        VERIFY_RETURN_TYPE                                       !4
         27      > RETURN                                                   !4
   42    28*       VERIFY_RETURN_TYPE                                       
         29*     > RETURN                                                   null

End of function buildplaceholdersconditional

Function buildplaceholdersimplode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/ZkEbd
function name:  buildPlaceholdersImplode
number of ops:  28
compiled vars:  !0 = $ar, !1 = $varprefix, !2 = $x, !3 = $bindparams, !4 = $placeholders, !5 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   46     4        ASSIGN                                                   !4, <array>
   47     5      > FE_RESET_R                                       $7      !0, ->19
          6    > > FE_FETCH_R                                               $7, !5, ->19
   48     7    >   ROPE_INIT                                     3  ~10     '%3A'
          8        ROPE_ADD                                      1  ~10     ~10, !1
          9        ROPE_END                                      2  ~9      ~10, !2
         10        ASSIGN_DIM                                               !4
         11        OP_DATA                                                  ~9
   49    12        ROPE_INIT                                     3  ~13     '%3A'
         13        ROPE_ADD                                      1  ~13     ~13, !1
         14        ROPE_END                                      2  ~12     ~13, !2
         15        ASSIGN_DIM                                               !3, ~12
         16        OP_DATA                                                  !5
   50    17        PRE_INC                                                  !2
   47    18      > JMP                                                      ->6
         19    >   FE_FREE                                                  $7
   52    20        INIT_FCALL                                               'implode'
         21        SEND_VAL                                                 '%2C'
         22        SEND_VAR                                                 !4
         23        DO_ICALL                                         $17     
         24        VERIFY_RETURN_TYPE                                       $17
         25      > RETURN                                                   $17
   53    26*       VERIFY_RETURN_TYPE                                       
         27*     > RETURN                                                   null

End of function buildplaceholdersimplode

Function buildplaceholderstrim:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/ZkEbd
function name:  buildPlaceholdersTrim
number of ops:  28
compiled vars:  !0 = $ar, !1 = $varprefix, !2 = $x, !3 = $bindparams, !4 = $sql, !5 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   57     4        ASSIGN                                                   !4, ''
   58     5      > FE_RESET_R                                       $7      !0, ->19
          6    > > FE_FETCH_R                                               $7, !5, ->19
   59     7    >   ROPE_INIT                                     4  ~9      '%3A'
          8        ROPE_ADD                                      1  ~9      ~9, !1
          9        ROPE_ADD                                      2  ~9      ~9, !2
         10        ROPE_END                                      3  ~8      ~9, '%2C'
         11        ASSIGN_OP                                     8          !4, ~8
   60    12        ROPE_INIT                                     3  ~13     '%3A'
         13        ROPE_ADD                                      1  ~13     ~13, !1
         14        ROPE_END                                      2  ~12     ~13, !2
         15        ASSIGN_DIM                                               !3, ~12
         16        OP_DATA                                                  !5
   61    17        PRE_INC                                                  !2
   58    18      > JMP                                                      ->6
         19    >   FE_FREE                                                  $7
   63    20        INIT_FCALL                                               'rtrim'
         21        SEND_VAR                                                 !4
         22        SEND_VAL                                                 '%2C'
         23        DO_ICALL                                         $17     
         24        VERIFY_RETURN_TYPE                                       $17
         25      > RETURN                                                   $17
   64    26*       VERIFY_RETURN_TYPE                                       
         27*     > RETURN                                                   null

End of function buildplaceholderstrim

Function buildplaceholdersregex:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 34
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 34
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/ZkEbd
function name:  buildPlaceholdersRegex
number of ops:  43
compiled vars:  !0 = $ar, !1 = $varprefix, !2 = $x, !3 = $bindparams, !4 = $count, !5 = $template, !6 = $sql, !7 = $temp_x, !8 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   67     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   68     4        COUNT                                            ~9      !0
          5        ASSIGN                                                   !4, ~9
   69     6        IS_IDENTICAL                                             !4, 0
          7      > JMPZ                                                     ~11, ->9
          8    > > RETURN                                                   ''
   71     9    >   INIT_FCALL                                               'str_repeat'
         10        SEND_VAL                                                 'X%2C'
         11        SEND_VAR                                                 !4
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !5, $12
   72    14        INIT_FCALL                                               'preg_replace_callback'
         15        SEND_VAL                                                 '%2FX%2F'
         16        DECLARE_LAMBDA_FUNCTION                          ~14     [0]
         17        BIND_LEXICAL                                             ~14, !1
         18        BIND_LEXICAL                                             ~14, !2
   74    19        SEND_VAL                                                 ~14
         20        SEND_VAR                                                 !5
   72    21        DO_ICALL                                         $15     
         22        ASSIGN                                                   !6, $15
   76    23        SUB                                              ~17     !2, !4
         24        ASSIGN                                                   !7, ~17
   77    25      > FE_RESET_R                                       $19     !0, ->34
         26    > > FE_FETCH_R                                               $19, !8, ->34
   78    27    >   ROPE_INIT                                     3  ~21     '%3A'
         28        ROPE_ADD                                      1  ~21     ~21, !1
         29        ROPE_END                                      2  ~20     ~21, !7
         30        ASSIGN_DIM                                               !3, ~20
         31        OP_DATA                                                  !8
   79    32        PRE_INC                                                  !7
   77    33      > JMP                                                      ->26
         34    >   FE_FREE                                                  $19
   82    35        INIT_FCALL                                               'rtrim'
         36        SEND_VAR                                                 !6
         37        SEND_VAL                                                 '%2C'
         38        DO_ICALL                                         $25     
         39        VERIFY_RETURN_TYPE                                       $25
         40      > RETURN                                                   $25
   83    41*       VERIFY_RETURN_TYPE                                       
         42*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZkEbd
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $varprefix, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   72     0  E >   BIND_STATIC                                              !0
          1        BIND_STATIC                                              !1
   73     2        NOP                                                      
          3        FAST_CONCAT                                      ~2      '%3A', !0
          4        POST_INC                                         ~3      !1
          5        CONCAT                                           ~4      ~2, ~3
          6      > RETURN                                                   ~4
   74     7*     > RETURN                                                   null

End of Dynamic Function 0

End of function buildplaceholdersregex

Function buildplaceholdersserializable:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 25
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/ZkEbd
function name:  buildPlaceholdersSerializable
number of ops:  40
compiled vars:  !0 = $ar, !1 = $varprefix, !2 = $x, !3 = $bindparams, !4 = $count, !5 = $placeholderSet, !6 = $value, !7 = $placeholder, !8 = $serialized, !9 = $newSet
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   86     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   87     4        COUNT                                            ~10     !0
          5        ASSIGN                                                   !4, ~10
   88     6        IS_IDENTICAL                                             !4, 0
          7      > JMPZ                                                     ~12, ->9
          8    > > RETURN                                                   ''
   90     9    >   NEW                                              $13     'PlaceholderSet'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !5, $13
   93    12      > FE_RESET_R                                       $16     !0, ->25
         13    > > FE_FETCH_R                                               $16, !6, ->25
   94    14    >   ROPE_INIT                                     3  ~18     '%3A'
         15        ROPE_ADD                                      1  ~18     ~18, !1
         16        ROPE_END                                      2  ~17     ~18, !2
         17        ASSIGN                                                   !7, ~17
   95    18        INIT_METHOD_CALL                                         !5, 'addPlaceholder'
         19        SEND_VAR_EX                                              !7
         20        DO_FCALL                                      0          
   96    21        ASSIGN_DIM                                               !3, !7
         22        OP_DATA                                                  !6
   97    23        PRE_INC                                                  !2
   93    24      > JMP                                                      ->13
         25    >   FE_FREE                                                  $16
  101    26        INIT_METHOD_CALL                                         !5, 'serialize'
         27        DO_FCALL                                      0  $24     
         28        ASSIGN                                                   !8, $24
  102    29        NEW                                              $26     'PlaceholderSet'
         30        DO_FCALL                                      0          
         31        ASSIGN                                                   !9, $26
  103    32        INIT_METHOD_CALL                                         !9, 'unserialize'
         33        SEND_VAR_EX                                           

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.15 ms | 1050 KiB | 20 Q