3v4l.org

run code in 300+ PHP versions simultaneously
<?php #echo "Hello, World!"; $stt = "<p><em>(Formerly SCS 1346 The Writer&rsquo;s Handbook)</em></p> <p>Good grammar is the bedrock of good writing. Designed for native or near-native speakers of English, this course will help you improve your skills in grammar and punctuation, whether you write for personal satisfaction or as part of your job. We&rsquo;ll review the basics of grammar and usage so you can write with more confidence, coherence and energy. Exercises and writing assignments will help you master the techniques of clear, correct and effective writing.</p>"; echo substr(strip_tags(stringClean($stt)),0,160) . '...'; function htmlClean( $html, $allowTags = '<p><a><strong><ul><ol><li><em><i>' ) { $html = str_replace(array ('<![CDATA[', ']]>'), '', utf8_encode($html)); $html = htmlspecialchars_decode($html, ENT_QUOTES); $html = html_entity_decode($html, ENT_QUOTES, 'UTF-8'); $html = str_replace('&apos;', '\'', $html); $html = str_replace('&nbsp;', ' ', $html); $html = strip_tags($html, $allowTags); $html = preg_replace('/(<p><\/p>|<p>\s<\/p>|<p>&nbsp;<\/p>)/im', '', $html); $html = trim($html); return preg_replace("/<([b-z][a-z0-9]*)[^>]*?(\/?)>/im", '<$1$2>', $html); } function stringClean( $str ) { $str = htmlspecialchars_decode($str, ENT_QUOTES); $str = html_entity_decode($str, ENT_QUOTES, 'UTF-8'); $str = str_replace('&apos;', '\'', $str); $str = str_replace('&nbsp;', ' ', $str); return trim($str); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UHsES
function name:  (null)
number of ops:  15
compiled vars:  !0 = $stt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, '%3Cp%3E%3Cem%3E%28Formerly+SCS+1346+The+Writer%26rsquo%3Bs+Handbook%29%3C%2Fem%3E%3C%2Fp%3E%0A%0A%3Cp%3EGood+grammar+is+the+bedrock+of+good+writing.+Designed+for+native+or+near-native+speakers+of+English%2C+this+course+will+help+you+improve+your+skills+in+grammar+and+punctuation%2C+whether+you+write+for+personal+satisfaction+or+as+part+of+your+job.+We%26rsquo%3Bll+review+the+basics+of+grammar+and+usage+so+you+can+write+with+more+confidence%2C+coherence+and+energy.+Exercises+and+writing+assignments+will+help+you+master+the+techniques+of+clear%2C+correct+and+effective+writing.%3C%2Fp%3E'
   12     1        INIT_FCALL                                               'substr'
          2        INIT_FCALL                                               'strip_tags'
          3        INIT_FCALL_BY_NAME                                       'stringClean'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        SEND_VAL                                                 0
         10        SEND_VAL                                                 160
         11        DO_ICALL                                         $4      
         12        CONCAT                                           ~5      $4, '...'
         13        ECHO                                                     ~5
   38    14      > RETURN                                                   1

Function htmlclean:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UHsES
function name:  htmlClean
number of ops:  56
compiled vars:  !0 = $html, !1 = $allowTags
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      '%3Cp%3E%3Ca%3E%3Cstrong%3E%3Cul%3E%3Col%3E%3Cli%3E%3Cem%3E%3Ci%3E'
   17     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 <array>
          4        SEND_VAL                                                 ''
          5        INIT_FCALL                                               'utf8_encode'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                         $3      
         10        ASSIGN                                                   !0, $3
   19    11        INIT_FCALL                                               'htmlspecialchars_decode'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 3
         14        DO_ICALL                                         $5      
         15        ASSIGN                                                   !0, $5
   20    16        INIT_FCALL                                               'html_entity_decode'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 3
         19        SEND_VAL                                                 'UTF-8'
         20        DO_ICALL                                         $7      
         21        ASSIGN                                                   !0, $7
   21    22        INIT_FCALL                                               'str_replace'
         23        SEND_VAL                                                 '%26apos%3B'
         24        SEND_VAL                                                 '%27'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $9      
         27        ASSIGN                                                   !0, $9
   22    28        INIT_FCALL                                               'str_replace'
         29        SEND_VAL                                                 '%26nbsp%3B'
         30        SEND_VAL                                                 '+'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                         $11     
         33        ASSIGN                                                   !0, $11
   24    34        INIT_FCALL                                               'strip_tags'
         35        SEND_VAR                                                 !0
         36        SEND_VAR                                                 !1
         37        DO_ICALL                                         $13     
         38        ASSIGN                                                   !0, $13
   25    39        INIT_FCALL                                               'preg_replace'
         40        SEND_VAL                                                 '%2F%28%3Cp%3E%3C%5C%2Fp%3E%7C%3Cp%3E%5Cs%3C%5C%2Fp%3E%7C%3Cp%3E%26nbsp%3B%3C%5C%2Fp%3E%29%2Fim'
         41        SEND_VAL                                                 ''
         42        SEND_VAR                                                 !0
         43        DO_ICALL                                         $15     
         44        ASSIGN                                                   !0, $15
   26    45        INIT_FCALL                                               'trim'
         46        SEND_VAR                                                 !0
         47        DO_ICALL                                         $17     
         48        ASSIGN                                                   !0, $17
   27    49        INIT_FCALL                                               'preg_replace'
         50        SEND_VAL                                                 '%2F%3C%28%5Bb-z%5D%5Ba-z0-9%5D%2A%29%5B%5E%3E%5D%2A%3F%28%5C%2F%3F%29%3E%2Fim'
         51        SEND_VAL                                                 '%3C%241%242%3E'
         52        SEND_VAR                                                 !0
         53        DO_ICALL                                         $19     
         54      > RETURN                                                   $19
   28    55*     > RETURN                                                   null

End of function htmlclean

Function stringclean:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UHsES
function name:  stringClean
number of ops:  29
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
   32     1        INIT_FCALL                                               'htmlspecialchars_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 3
          4        DO_ICALL                                         $1      
          5        ASSIGN                                                   !0, $1
   33     6        INIT_FCALL                                               'html_entity_decode'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 3
          9        SEND_VAL                                                 'UTF-8'
         10        DO_ICALL                                         $3      
         11        ASSIGN                                                   !0, $3
   34    12        INIT_FCALL                                               'str_replace'
         13        SEND_VAL                                                 '%26apos%3B'
         14        SEND_VAL                                                 '%27'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $5      
         17        ASSIGN                                                   !0, $5
   35    18        INIT_FCALL                                               'str_replace'
         19        SEND_VAL                                                 '%26nbsp%3B'
         20        SEND_VAL                                                 '+'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $7      
         23        ASSIGN                                                   !0, $7
   37    24        INIT_FCALL                                               'trim'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $9      
         27      > RETURN                                                   $9
   38    28*     > RETURN                                                   null

End of function stringclean

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.95 ms | 1404 KiB | 29 Q