PHP code example of suzunone / code-runner

1. Go to this page and download the library: Download suzunone/code-runner library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

suzunone / code-runner example snippets

 .php


use Suzunone\CodeRunner\CodeRunner;

$source_code = 'console.log("Hello, world...");';

$CodeRunner = new CodeRunner;

$entity = $CodeRunner->create($source_code, CodeRunner::LANG_JAVASCRIPT);
while ($entity->is_running) {
    $entity = $entity->status();
    sleep(1);
}

var_dump($entity->details()->toArray());
 .php
\Suzunone\CodeRunner\Entities\OutputEntityInterface
 .php
string
 .php
string
 .php
string
 .php
string
 .php
string
 .php

OutputEntityInterface::status(): StatusEntity;

 .php
Suzunone\CodeRunner\Entities\Input|StatusEntity
 .php
OutputEntityInterface::details(): StatusEntity;

 .php
Suzunone\CodeRunner\Entities\Input|StatusEntity
 .php
getResponse() : ResponseElementInterface
 .php
Suzunone\CodeRunner\Entities\Elements\Input|ResponseElementInterface
 .php

 .php