3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_content() { return ' person_ID,name,first,last,middle,email,phone,fax,title 3130,"Burks, Rosella ",Rosella,Burks,,BurksR@univ.edu,963.555.1253,963.777.4065,Professor 3297,"Avila, Damien ",Damien,Avila,,AvilaD@univ.edu,963.555.1352,963.777.7914,Professor 3547,"Olsen, Robin ",Robin,Olsen,,OlsenR@univ.edu,963.555.1378,963.777.9262,Assistant Professor 1538,"Moises, Edgar Estes",Edgar,Moises,Estes,MoisesE@univ.edu,963.555.2731x3565,963.777.8264,Professor 2941,"Brian, Heath Pruitt",Heath,Brian,Pruitt,BrianH@univ.edu,963.555.2800,963.777.7249,Associate Curator 2401,"Claude, Elvin Haney",Elvin,Claude,Haney,ClaudeE@univ.edu,963.555.2902,963.777.9730,Curator 2070,"Mosley, Edmund ",Edmund,Mosley,,MosleyE@univ.edu,963.555.2945,963.777.9285,Assistant Professor 2561,"Derek, Antoine Mccoy",Antoine,Derek,Mccoy,DerekA@univ.edu,963.555.2992,963.777.5454,Curator 1625,"Hawkins, Callie ",Callie,Hawkins,,HawkinsC@univ.edu,963.555.3350x6480,963.777.4949,Professor 1307,"Pate, Andrea ",Andrea,Pate,,PateA@univ.edu,963.555.3723,963.777.5049,Professor 2342,"Austin, Liz ",Liz,Austin,,AustinL@univ.edu,963.555.4305,963.777.6143,Assistant Professor 2755,"Kendrick, Reba Alford",Reba,Kendrick,Alford,KendrickR@univ.edu,963.555.4618x7744,963.777.4371,Associate Curator 4150,"Sims, Angelina ",Angelina,Sims,,SimsA@univ.edu,963.555.5278,963.777.4400,Professor 3544,"Mullins, Kimberly ",Kimberly,Mullins,,MullinsK@univ.edu,963.555.5471x1017,963.777.9783,Assistant Professor 2096,"Chuck, Lloyd Haney",Lloyd,Chuck,Haney,ChuckL@univ.edu,963.555.5568x2652,963.777.9290,Assistant Professor 1089,"Payne, Ladonna ",Ladonna,Payne,,PayneL@univ.edu,963.555.5639,963.777.6469,Professor 2948,"Baxter, Johnathan Browning",Johnathan,Baxter,Browning,BaxterJ@univ.edu,963.555.5902,963.777.8336,Research Professor 4539,"Weiss, Gilbert ",Gilbert,Weiss,,WeissG@univ.edu,963.555.5969,963.777.4975,Professor 2811,"Deirdre, Florence Barrera",Florence,Deirdre,Barrera,DeirdreF@univ.edu,963.555.6319,963.777.9654,Associate Curator 4580,"Fernando, Toby Calderon",Toby,Fernando,Calderon,FernandoT@univ.edu,963.555.6469,963.777.9864,Research Professor 2895,"Garrison, Patrica ",Patrica,Garrison,,GarrisonP@univ.edu,963.555.6760,963.777.4958,Associate Curator 2254,"Effie, Leila Vinson",Leila,Effie,Vinson,EffieL@univ.edu,963.555.6824,963.777.7299,Assistant Professor 2389,"Buckley, Rose ",Rose,Buckley,,BuckleyR@univ.edu,963.555.6855x5018,963.777.5233,Curator 1699,"Stanton, Kathie ",Kathie,Stanton,,StantonK@univ.edu,963.555.7095,963.777.1015,Professor 1567,"Banks, Shannon ",Shannon,Banks,,BanksS@univ.edu,963.555.7198,963.777.6979,Professor 3066,"Barnes, Cleo ",Cleo,Barnes,,BarnesC@univ.edu,963.555.7463x7335,963.777.1583,Research Professor 2426,"Brady, Nellie ",Nellie,Brady,,BradyN@univ.edu,963.555.7569,963.777.7218,Curator 2217,"Katheryn, Ruben Holt",Ruben,Katheryn,Holt,KatherynR@univ.edu,963.555.7578,963.777.3969,Assistant Professor 1968,"Michael, Dianne ",Dianne,Michael,,MichaelD@univ.edu,963.555.7592,963.777.9960,Assistant Professor 3012,"Grant, Adam ",Adam,Grant,,GrantA@univ.edu,963.555.7775,963.777.8115,Research Professor 1824,"Head, Kurtis ",Kurtis,Head,,HeadK@univ.edu,963.555.7882,963.777.6348,Professor 3929,"Berger, Jami ",Jami,Berger,,BergerJ@univ.edu,963.555.8158,963.777.5650,Research Professor 2682,"Earline, Jaime Fitzgerald",Jaime,Earline,Fitzgerald,EarlineJ@univ.edu,963.555.8357,963.777.4114,Associate Curator 3112,"Evelyn, Summer Frost",Summer,Evelyn,Frost,EvelynS@univ.edu,963.555.8895,963.777.5730,Professor 2303,"Quentin, Sam Hyde",Sam,Quentin,Hyde,QuentinS@univ.edu,963.555.8921,963.777.2712,Assistant Professor 3903,"Dunlap, Ann ",Ann,Dunlap,,DunlapA@univ.edu,963.555.9067,963.777.4290,Assistant Professor 3095,"Shields, Rich Pena",Rich,Shields,Pena,ShieldsR@univ.edu,963.555.9197,963.777.7215,Professor 2383,"Page, Winnie ",Winnie,Page,,PageW@univ.edu,963.555.9366,963.777.3202,Curator 2146,"Sparks, Ezra ",Ezra,Sparks,,SparksE@univ.edu,963.555.9390,963.777.9273,Assistant Professor '; } $capture = array( 1 => [], 2 => [], ); function captures_differ():bool { global $capture; $diff = false; $n = min(count($capture[1]),count($capture[2])); for($i = 0; $i < $n; $i++) { if ($capture[1][$i] === $capture[2][$i]) { continue; } echo "======>\n"; echo $i, ": '",$capture[1][$i], "' !== '", $capture[2][$i], "'\n"; echo "<======\n"; echo "\n"; $diff = true; } return $diff; } // Function to benchmark strtok function benchmarkStrtok($content, $iterations) { //global $capture; $start = microtime(true); for ($i = 0; $i < $iterations; $i++) { $token = strtok($content, ','); while ($token !== false) { //$capture[1][] = $token; $token = strtok(','); } } $end = microtime(true); return $end - $start; } // Function to benchmark explode function benchmarkModernStrtok($content, $iterations) { //global $capture; $start = microtime(true); $content_len = strlen($content); for ($i = 0; $i < $iterations; $i++) { $pos = 0; while (true) { $pos += \strspn($content, ',', $pos); $len = \strcspn($content, ',', $pos); $token = substr($content, $pos, $len); if ($pos >= $content_len ) { break; } $pos += $len; //$capture[2][] = $token; } } $end = microtime(true); return $end - $start; } // Main script execution $content = get_content(); $bytes = strlen($content); $commas = count(explode(",",$content))-1; $iterations = 100; $timeStrtok = benchmarkStrtok($content, $iterations); $timeMS = benchmarkModernStrtok($content, $iterations); //if ( captures_differ() ) { // echo "ERROR: Mismatch"; // exit(1); //} $timesFaster = round($timeMS/$timeStrtok,4); $timeStrtok = round($timeStrtok,4); $timeMS = round($timeMS,4); echo "Size of file: $bytes\n"; echo "Number of commas: $commas\n"; echo "Time for strtok: $timeStrtok seconds\n"; echo "Time for ModernStrTok: $timeMS seconds\n"; echo "strtok() time delta: $timesFaster\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVS5Md
function name:  (null)
number of ops:  61
compiled vars:  !0 = $capture, !1 = $content, !2 = $bytes, !3 = $commas, !4 = $iterations, !5 = $timeStrtok, !6 = $timeMS, !7 = $timesFaster
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   ASSIGN                                                   !0, <array>
  104     1        INIT_FCALL                                               'get_content'
          2        DO_FCALL                                      0  $9      
          3        ASSIGN                                                   !1, $9
  105     4        STRLEN                                           ~11     !1
          5        ASSIGN                                                   !2, ~11
  106     6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%2C'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $13     
         10        COUNT                                            ~14     $13
         11        SUB                                              ~15     ~14, 1
         12        ASSIGN                                                   !3, ~15
  108    13        ASSIGN                                                   !4, 100
  110    14        INIT_FCALL                                               'benchmarkstrtok'
         15        SEND_VAR                                                 !1
         16        SEND_VAR                                                 !4
         17        DO_FCALL                                      0  $18     
         18        ASSIGN                                                   !5, $18
  111    19        INIT_FCALL                                               'benchmarkmodernstrtok'
         20        SEND_VAR                                                 !1
         21        SEND_VAR                                                 !4
         22        DO_FCALL                                      0  $20     
         23        ASSIGN                                                   !6, $20
  118    24        INIT_FCALL                                               'round'
         25        DIV                                              ~22     !6, !5
         26        SEND_VAL                                                 ~22
         27        SEND_VAL                                                 4
         28        DO_ICALL                                         $23     
         29        ASSIGN                                                   !7, $23
  120    30        INIT_FCALL                                               'round'
         31        SEND_VAR                                                 !5
         32        SEND_VAL                                                 4
         33        DO_ICALL                                         $25     
         34        ASSIGN                                                   !5, $25
  121    35        INIT_FCALL                                               'round'
         36        SEND_VAR                                                 !6
         37        SEND_VAL                                                 4
         38        DO_ICALL                                         $27     
         39        ASSIGN                                                   !6, $27
  123    40        ROPE_INIT                                     3  ~30     'Size+of+file%3A+++++++++++'
         41        ROPE_ADD                                      1  ~30     ~30, !2
         42        ROPE_END                                      2  ~29     ~30, '%0A'
         43        ECHO                                                     ~29
  124    44        ROPE_INIT                                     3  ~33     'Number+of+commas%3A+++++++'
         45        ROPE_ADD                                      1  ~33     ~33, !3
         46        ROPE_END                                      2  ~32     ~33, '%0A'
         47        ECHO                                                     ~32
  125    48        ROPE_INIT                                     3  ~36     'Time+for+strtok%3A++++++++'
         49        ROPE_ADD                                      1  ~36     ~36, !5
         50        ROPE_END                                      2  ~35     ~36, '+seconds%0A'
         51        ECHO                                                     ~35
  126    52        ROPE_INIT                                     3  ~39     'Time+for+ModernStrTok%3A++'
         53        ROPE_ADD                                      1  ~39     ~39, !6
         54        ROPE_END                                      2  ~38     ~39, '+seconds%0A'
         55        ECHO                                                     ~38
  127    56        ROPE_INIT                                     3  ~42     'strtok%28%29+time+delta%3A++++'
         57        ROPE_ADD                                      1  ~42     ~42, !7
         58        ROPE_END                                      2  ~41     ~42, '%0A'
         59        ECHO                                                     ~41
         60      > RETURN                                                   1

Function get_content:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVS5Md
function name:  get_content
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > RETURN                                                   '%0Aperson_ID%2Cname%2Cfirst%2Clast%2Cmiddle%2Cemail%2Cphone%2Cfax%2Ctitle%0A3130%2C%22Burks%2C+Rosella+%22%2CRosella%2CBurks%2C%2CBurksR%40univ.edu%2C963.555.1253%2C963.777.4065%2CProfessor%0A3297%2C%22Avila%2C+Damien+%22%2CDamien%2CAvila%2C%2CAvilaD%40univ.edu%2C963.555.1352%2C963.777.7914%2CProfessor%0A3547%2C%22Olsen%2C+Robin+%22%2CRobin%2COlsen%2C%2COlsenR%40univ.edu%2C963.555.1378%2C963.777.9262%2CAssistant+Professor%0A1538%2C%22Moises%2C+Edgar+Estes%22%2CEdgar%2CMoises%2CEstes%2CMoisesE%40univ.edu%2C963.555.2731x3565%2C963.777.8264%2CProfessor%0A2941%2C%22Brian%2C+Heath+Pruitt%22%2CHeath%2CBrian%2CPruitt%2CBrianH%40univ.edu%2C963.555.2800%2C963.777.7249%2CAssociate+Curator%0A2401%2C%22Claude%2C+Elvin+Haney%22%2CElvin%2CClaude%2CHaney%2CClaudeE%40univ.edu%2C963.555.2902%2C963.777.9730%2CCurator%0A2070%2C%22Mosley%2C+Edmund+%22%2CEdmund%2CMosley%2C%2CMosleyE%40univ.edu%2C963.555.2945%2C963.777.9285%2CAssistant+Professor%0A2561%2C%22Derek%2C+Antoine+Mccoy%22%2CAntoine%2CDerek%2CMccoy%2CDerekA%40univ.edu%2C963.555.2992%2C963.777.5454%2CCurator%0A1625%2C%22Hawkins%2C+Callie+%22%2CCallie%2CHawkins%2C%2CHawkinsC%40univ.edu%2C963.555.3350x6480%2C963.777.4949%2CProfessor%0A1307%2C%22Pate%2C+Andrea+%22%2CAndrea%2CPate%2C%2CPateA%40univ.edu%2C963.555.3723%2C963.777.5049%2CProfessor%0A2342%2C%22Austin%2C+Liz+%22%2CLiz%2CAustin%2C%2CAustinL%40univ.edu%2C963.555.4305%2C963.777.6143%2CAssistant+Professor%0A2755%2C%22Kendrick%2C+Reba+Alford%22%2CReba%2CKendrick%2CAlford%2CKendrickR%40univ.edu%2C963.555.4618x7744%2C963.777.4371%2CAssociate+Curator%0A4150%2C%22Sims%2C+Angelina+%22%2CAngelina%2CSims%2C%2CSimsA%40univ.edu%2C963.555.5278%2C963.777.4400%2CProfessor%0A3544%2C%22Mullins%2C+Kimberly+%22%2CKimberly%2CMullins%2C%2CMullinsK%40univ.edu%2C963.555.5471x1017%2C963.777.9783%2CAssistant+Professor%0A2096%2C%22Chuck%2C+Lloyd+Haney%22%2CLloyd%2CChuck%2CHaney%2CChuckL%40univ.edu%2C963.555.5568x2652%2C963.777.9290%2CAssistant+Professor%0A1089%2C%22Payne%2C+Ladonna+%22%2CLadonna%2CPayne%2C%2CPayneL%40univ.edu%2C963.555.5639%2C963.777.6469%2CProfessor%0A2948%2C%22Baxter%2C+Johnathan+Browning%22%2CJohnathan%2CBaxter%2CBrowning%2CBaxterJ%40univ.edu%2C963.555.5902%2C963.777.8336%2CResearch+Professor%0A4539%2C%22Weiss%2C+Gilbert+%22%2CGilbert%2CWeiss%2C%2CWeissG%40univ.edu%2C963.555.5969%2C963.777.4975%2CProfessor%0A2811%2C%22Deirdre%2C+Florence+Barrera%22%2CFlorence%2CDeirdre%2CBarrera%2CDeirdreF%40univ.edu%2C963.555.6319%2C963.777.9654%2CAssociate+Curator%0A4580%2C%22Fernando%2C+Toby+Calderon%22%2CToby%2CFernando%2CCalderon%2CFernandoT%40univ.edu%2C963.555.6469%2C963.777.9864%2CResearch+Professor%0A2895%2C%22Garrison%2C+Patrica+%22%2CPatrica%2CGarrison%2C%2CGarrisonP%40univ.edu%2C963.555.6760%2C963.777.4958%2CAssociate+Curator%0A2254%2C%22Effie%2C+Leila+Vinson%22%2CLeila%2CEffie%2CVinson%2CEffieL%40univ.edu%2C963.555.6824%2C963.777.7299%2CAssistant+Professor%0A2389%2C%22Buckley%2C+Rose+%22%2CRose%2CBuckley%2C%2CBuckleyR%40univ.edu%2C963.555.6855x5018%2C963.777.5233%2CCurator%0A1699%2C%22Stanton%2C+Kathie+%22%2CKathie%2CStanton%2C%2CStantonK%40univ.edu%2C963.555.7095%2C963.777.1015%2CProfessor%0A1567%2C%22Banks%2C+Shannon+%22%2CShannon%2CBanks%2C%2CBanksS%40univ.edu%2C963.555.7198%2C963.777.6979%2CProfessor%0A3066%2C%22Barnes%2C+Cleo+%22%2CCleo%2CBarnes%2C%2CBarnesC%40univ.edu%2C963.555.7463x7335%2C963.777.1583%2CResearch+Professor%0A2426%2C%22Brady%2C+Nellie+%22%2CNellie%2CBrady%2C%2CBradyN%40univ.edu%2C963.555.7569%2C963.777.7218%2CCurator%0A2217%2C%22Katheryn%2C+Ruben+Holt%22%2CRuben%2CKatheryn%2CHolt%2CKatherynR%40univ.edu%2C963.555.7578%2C963.777.3969%2CAssistant+Professor%0A1968%2C%22Michael%2C+Dianne+%22%2CDianne%2CMichael%2C%2CMichaelD%40univ.edu%2C963.555.7592%2C963.777.9960%2CAssistant+Professor%0A3012%2C%22Grant%2C+Adam+%22%2CAdam%2CGrant%2C%2CGrantA%40univ.edu%2C963.555.7775%2C963.777.8115%2CResearch+Professor%0A1824%2C%22Head%2C+Kurtis+%22%2CKurtis%2CHead%2C%2CHeadK%40univ.edu%2C963.555.7882%2C963.777.6348%2CProfessor%0A3929%2C%22Berger%2C+Jami+%22%2CJami%2CBerger%2C%2CBergerJ%40univ.edu%2C963.555.8158%2C963.777.5650%2CResearch+Professor%0A2682%2C%22Earline%2C+Jaime+Fitzgerald%22%2CJaime%2CEarline%2CFitzgerald%2CEarlineJ%40univ.edu%2C963.555.8357%2C963.777.4114%2CAssociate+Curator%0A3112%2C%22Evelyn%2C+Summer+Frost%22%2CSummer%2CEvelyn%2CFrost%2CEvelynS%40univ.edu%2C963.555.8895%2C963.777.5730%2CProfessor%0A2303%2C%22Quentin%2C+Sam+Hyde%22%2CSam%2CQuentin%2CHyde%2CQuentinS%40univ.edu%2C963.555.8921%2C963.777.2712%2CAssistant+Professor%0A3903%2C%22Dunlap%2C+Ann+%22%2CAnn%2CDunlap%2C%2CDunlapA%40univ.edu%2C963.555.9067%2C963.777.4290%2CAssistant+Professor%0A3095%2C%22Shields%2C+Rich+Pena%22%2CRich%2CShields%2CPena%2CShieldsR%40univ.edu%2C963.555.9197%2C963.777.7215%2CProfessor%0A2383%2C%22Page%2C+Winnie+%22%2CWinnie%2CPage%2C%2CPageW%40univ.edu%2C963.555.9366%2C963.777.3202%2CCurator%0A2146%2C%22Sparks%2C+Ezra+%22%2CEzra%2CSparks%2C%2CSparksE%40univ.edu%2C963.555.9390%2C963.777.9273%2CAssistant+Professor%0A'
   45     1*     > RETURN                                                   null

End of function get_content

Function captures_differ:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 13
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 13
Branch analysis from position: 37
Branch analysis from position: 13
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 13
Branch analysis from position: 37
Branch analysis from position: 13
filename:       /in/ZVS5Md
function name:  captures_differ
number of ops:  41
compiled vars:  !0 = $capture, !1 = $diff, !2 = $n, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   BIND_GLOBAL                                              !0, 'capture'
   53     1        ASSIGN                                                   !1, <false>
   54     2        INIT_FCALL                                               'min'
          3        FETCH_DIM_R                                      ~5      !0, 1
          4        COUNT                                            ~6      ~5
          5        SEND_VAL                                                 ~6
          6        FETCH_DIM_R                                      ~7      !0, 2
          7        COUNT                                            ~8      ~7
          8        SEND_VAL                                                 ~8
          9        DO_ICALL                                         $9      
         10        ASSIGN                                                   !2, $9
   55    11        ASSIGN                                                   !3, 0
         12      > JMP                                                      ->35
   56    13    >   FETCH_DIM_R                                      ~12     !0, 1
         14        FETCH_DIM_R                                      ~13     ~12, !3
         15        FETCH_DIM_R                                      ~14     !0, 2
         16        FETCH_DIM_R                                      ~15     ~14, !3
         17        IS_IDENTICAL                                             ~13, ~15
         18      > JMPZ                                                     ~16, ->20
   57    19    > > JMP                                                      ->34
   59    20    >   ECHO                                                     '%3D%3D%3D%3D%3D%3D%3E%0A'
   60    21        ECHO                                                     !3
         22        ECHO                                                     '%3A+%27'
         23        FETCH_DIM_R                                      ~17     !0, 1
         24        FETCH_DIM_R                                      ~18     ~17, !3
         25        ECHO                                                     ~18
         26        ECHO                                                     '%27+%21%3D%3D+%27'
         27        FETCH_DIM_R                                      ~19     !0, 2
         28        FETCH_DIM_R                                      ~20     ~19, !3
         29        ECHO                                                     ~20
         30        ECHO                                                     '%27%0A'
   61    31        ECHO                                                     '%3C%3D%3D%3D%3D%3D%3D%0A'
   62    32        ECHO                                                     '%0A'
   63    33        ASSIGN                                                   !1, <true>
   55    34    >   PRE_INC                                                  !3
         35    >   IS_SMALLER                                               !3, !2
         36      > JMPNZ                                                    ~23, ->13
   65    37    >   VERIFY_RETURN_TYPE                                       !1
         38      > RETURN                                                   !1
   66    39*       VERIFY_RETURN_TYPE                                       
         40*     > RETURN                                                   null

End of function captures_differ

Function benchmarkstrtok:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 8
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 14
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 8
Branch analysis from position: 23
Branch analysis from position: 8
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 14
Branch analysis from position: 20
Branch analysis from position: 14
filename:       /in/ZVS5Md
function name:  benchmarkStrtok
number of ops:  30
compiled vars:  !0 = $content, !1 = $iterations, !2 = $start, !3 = $i, !4 = $token, !5 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   68     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   70     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !2, $6
   71     6        ASSIGN                                                   !3, 0
          7      > JMP                                                      ->21
   72     8    >   INIT_FCALL                                               'strtok'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 '%2C'
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !4, $9
   73    13      > JMP                                                      ->18
   75    14    >   INIT_FCALL                                               'strtok'
         15        SEND_VAL                                                 '%2C'
         16        DO_ICALL                                         $11     
         17        ASSIGN                                                   !4, $11
   73    18    >   TYPE_CHECK                                  1018          !4
         19      > JMPNZ                                                    ~13, ->14
   71    20    >   PRE_INC                                                  !3
         21    >   IS_SMALLER                                               !3, !1
         22      > JMPNZ                                                    ~15, ->8
   78    23    >   INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $16     
         26        ASSIGN                                                   !5, $16
   79    27        SUB                                              ~18     !5, !2
         28      > RETURN                                                   ~18
   80    29*     > RETURN                                                   null

End of function benchmarkstrtok

Function benchmarkmodernstrtok:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 10
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 12
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 10
Branch analysis from position: 38
Branch analysis from position: 10
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 33
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 12
Branch analysis from position: 35
Branch analysis from position: 12
filename:       /in/ZVS5Md
function name:  benchmarkModernStrtok
number of ops:  45
compiled vars:  !0 = $content, !1 = $iterations, !2 = $start, !3 = $content_len, !4 = $i, !5 = $pos, !6 = $len, !7 = $token, !8 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   83     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   85     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $9      
          5        ASSIGN                                                   !2, $9
   86     6        STRLEN                                           ~11     !0
          7        ASSIGN                                                   !3, ~11
   87     8        ASSIGN                                                   !4, 0
          9      > JMP                                                      ->36
   88    10    >   ASSIGN                                                   !5, 0
   89    11      > JMP                                                      ->34
   90    12    >   INIT_FCALL                                               'strspn'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 '%2C'
         15        SEND_VAR                                                 !5
         16        DO_ICALL                                         $15     
         17        ASSIGN_OP                                     1          !5, $15
   91    18        INIT_FCALL                                               'strcspn'
         19        SEND_VAR                                                 !0
         20        SEND_VAL                                                 '%2C'
         21        SEND_VAR                                                 !5
         22        DO_ICALL                                         $17     
         23        ASSIGN                                                   !6, $17
   92    24        INIT_FCALL                                               'substr'
         25        SEND_VAR                                                 !0
         26        SEND_VAR                                                 !5
         27        SEND_VAR                                                 !6
         28        DO_ICALL                                         $19     
         29        ASSIGN                                                   !7, $19
   93    30        IS_SMALLER_OR_EQUAL                                      !3, !5
         31      > JMPZ                                                     ~21, ->33
   94    32    > > JMP                                                      ->35
   96    33    >   ASSIGN_OP                                     1          !5, !6
   89    34    > > JMPNZ                                                    <true>, ->12
   87    35    >   PRE_INC                                                  !4
         36    >   IS_SMALLER                                               !4, !1
         37      > JMPNZ                                                    ~24, ->10
  100    38    >   INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $25     
         41        ASSIGN                                                   !8, $25
  101    42        SUB                                              ~27     !8, !2
         43      > RETURN                                                   ~27
  102    44*     > RETURN                                                   null

End of function benchmarkmodernstrtok

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.6 ms | 1457 KiB | 24 Q