3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $info1 = array();$info2 = array();$info3 = array();$info4 = array(); $info1['multiply'] = $info2['multiply'] = $info3['multiply'] = 1000; $info2['close'] = 51.74; $info2['high'] = 52.017; $info2['open'] = 51.687; $info2['low'] = 51.666; $info1['close'] = 51.74; $info1['high'] = 52.017; $info1['open'] = 51.687; $info1['low'] = 51.666; $info3['close'] = 51.731; $info3['high'] = 52.013; $info3['open'] = 51.744; $info3['low'] = 51.703; $info4['close'] = 51.692; $info4['high'] = 51.955; $info4['open'] = 51.732; $info4['low'] = 51.692; $typicalSpread = 2400; $spikes = array(); if (abs($info1['close'] * $info1['multiply'] - $info2['high'] * $info1['multiply']) >= $typicalSpread) { if (abs($info2['high'] * $info1['multiply'] - $info3['open'] * $info1['multiply']) >= $typicalSpread) { if (abs($info3['high'] * $info1['multiply'] - $info2['close'] * $info1['multiply']) < $typicalSpread && abs($info3['high'] * $info1['multiply'] - $info4['open'] * $info1['multiply']) < $typicalSpread) { echo 'first'; } } else { if (abs($info3['high'] * $info1['multiply'] - $info2['close'] * $info1['multiply']) < $typicalSpread && abs($info3['high'] * $info1['multiply'] - $info4['open'] * $info1['multiply']) >= $typicalSpread) { echo 'second'; } } } if (abs($info1['close'] * $info1['multiply'] - $info2['low'] * $info1['multiply']) >= $typicalSpread) { if (abs($info2['low'] * $info1['multiply'] - $info3['open'] * $info1['multiply']) >= $typicalSpread) { if (abs($info3['low'] * $info1['multiply'] - $info2['close'] * $info1['multiply']) < $typicalSpread && abs($info3['low'] * $info1['multiply'] - $info4['open'] * $info1['multiply']) < $typicalSpread) { echo 'third'; } } else { if (abs($info3['low'] * $info1['multiply'] - $info2['close'] * $info1['multiply']) < $typicalSpread && abs($info3['low'] * $info1['multiply'] - $info4['open'] * $info1['multiply']) >= $typicalSpread) { echo 'fourth'; } } } echo 'no spikes'
based on MppDE
Output for 5.4.0 - 5.6.8
Parse error: syntax error, unexpected end of file, expecting ',' or ';' in /in/Fra18 on line 55
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected $end, expecting ',' or ';' in /in/Fra18 on line 55
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected $, expecting ',' or ';' in /in/Fra18 on line 55
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/Fra18 on line 55
Process exited with code 255.