while(true){ echo eval($input->get()); }  composer require d11wtq/boris dev-master  git clone git://github.com/d11wtq/boris.git cd boris ./bin/boris  boris> ctrl + c . By default, all results are var_dump by the var_dump function var_dump boris> $x = 1; int(1) boris> $y = 2; int(2) boris> "x + y = " . ($x + $y); string(9) "x + y = 3" boris> exit; ctrl + D require_once 'lib/autoload.php'; $boris = new \Boris\Boris('myapp> '); $boris->setLocal(array('appContext' => $appContext)); $boris->start(); appContext variable available from Boris. $boris->onStart('$foo = 42; $bar = 2; echo "Hello Boris!\n";'); $boris->onStart(function($worker, $scope){ extract($scope); echo '$foo * $bar = ' . ($foo * $bar) . "\n"; $worker->setLocal('name', 'Chris'); }); eval . Then we execute a callback, which exports data from the scope of Boris, performs some actions with them, and then adds the $name variable to Boris.Source: https://habr.com/ru/post/179145/
All Articles