3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $line = "9938275IBUPROFENIX 400 mg comp.x 10 00000594NNPhoenix 00000062220110810001001803827517791848330116001010NNN00"; $str = trim(trim(substr($line, 7, 44)) . ' ' . trim(substr($line, 51, 24))); $changes = array( 'E1' => 'B', 'A7' => 'º', 'A5' => 'Ñ', 'A4' => 'ñ', 'A3' => 'ú', 'A2' => 'ó', 'A1' => 'í', '82' => 'é', 'A0' => 'á', '9A' => 'U', ); foreach ($changes as $key => $value){ $str = $this->doFix($str, $key, $value); } $str = str_replace(',', ', ', $str); $str = str_replace('+', ' + ', $str); $str = str_replace('¥', 'Ñ', $str); $str = str_replace('š', 'U', $str); $str = ucfirst(trim($str)); $str = preg_replace('/\s+/', ' ', $str); $brand = trim(substr($line, 7, 44)); echo $str . '----'; echo $brand . '----';
based on 5MN4f
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Using $this when not in object context in /in/hs0OP:20 Stack trace: #0 {main} thrown in /in/hs0OP on line 20
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Using $this when not in object context in /in/hs0OP on line 20
Process exited with code 255.