3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace SComparison; class Comparator { protected $_strings = array(); protected $_tests = array(); protected $_hash; public function __construct() { $this->_hash = new SHash(); } /** * converting input data */ protected function _prepareInput() { foreach ($this->_strings as $key => $string) { $this->_tests[$key] = str_replace(" ", "", strtolower($string)); } } protected function _outputInteractive($key) { echo "String: " . $this->_strings[$key] . "\n"; echo "Test: " . $this->_tests[$key] . "\n"; echo "Hash: " . $this->_hash->getHash(SHash::HASH_BIN) . " - " . $this->_hash->getHash() . "\n"; echo "-----------------------------------------------------------\n"; } /** * executing comparison action */ public function runInteractive() { $this->_prepareInput(); foreach ($this->_tests as $key => $test) { $this->_hash->setString($test); $this->_hash->getHash(); $this->_outputInteractive($key); } } public function runCL() { $this->_prepareInput(); foreach ($this->_tests as $key => $test) { $this->_hash->setString($test); $this->_hash->getHash(); $this->_outputInteractive($key); } } public function setStrings(array $strings) { $this->_strings = $strings; } }
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STRING in /in/aKjmm on line 2
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 T_STRING in /in/aKjmm on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/aKjmm on line 2
Process exited with code 255.