3v4l.org

run code in 300+ PHP versions simultaneously
<?php $message = "This is a string using the terms? Wait here's one\n abukuma kai\nabukuma-kai\nabukuma\nabukuma\nkai abukuma abukuma kai"; $bigFatArray = array( '/abukuma kai/i' => '<a href="http://kancolle.wikia.com/wiki/Abukuma#Upgrade" class="screenshot" rel="ship/Abukuma_Kai.png" style="color:#0073e6; font-weight:bold; border-bottom: 1px #0073e6 dashed;"><p id="yosup">Abukuma Kai</p></a>', '/abukuma/i' => '<a href="http://kancolle.wikia.com/wiki/Abukuma#Basic" class="screenshot" rel="ship/Abukuma.png" style="color:#0073e6; font-weight:bold; border-bottom: 1px #0073e6 dashed;">Abukuma</a>' ); $searchFor = array_keys($bigFatArray); $replaceIt = array_values($bigFatArray); $result = preg_replace($searchFor, $replaceIt, $message); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pNVQJ
function name:  (null)
number of ops:  20
compiled vars:  !0 = $message, !1 = $bigFatArray, !2 = $searchFor, !3 = $replaceIt, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'This+is+a+string+using+the+terms%3F++Wait+here%27s+one%0A+abukuma+kai%0Aabukuma-kai%0Aabukuma%0Aabukuma%0Akai+abukuma+abukuma+kai'
    5     1        ASSIGN                                                   !1, <array>
   10     2        INIT_FCALL                                               'array_keys'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !2, $7
   12     6        INIT_FCALL                                               'array_values'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !3, $9
   14    10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !3
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !4, $11
   17    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !4
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.75 ms | 1395 KiB | 21 Q