Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Rx\Observable; use Rx\Observable; use Rx\ObserverInterface; use Rx\Sched..

Decoded Output download

<?php

namespace Rx\Observable;

use Rx\Observable;
use Rx\ObserverInterface;
use Rx\Scheduler\ImmediateScheduler;
use Rx\SchedulerInterface;

class ArrayObservable extends Observable
{
    private $data;

    public function __construct(array $data)
    {
        $this->data = $data;
    }

    public function subscribe(ObserverInterface $observer, SchedulerInterface $scheduler = null)
    {
        $values    = &$this->data;
        $max       = count($values);
        $keys      = array_keys($values);
        $count     = 0;

        if ($scheduler === null) {
            $scheduler = new ImmediateScheduler();
        }

        return $scheduler->scheduleRecursive(function ($reschedule) use (&$observer, &$values, $max, &$count, $keys) {
            if ($count < $max) {
                $observer->onNext($values[$keys[$count]]);
                $count++;
                if ($count >= 1) {
                    $reschedule();
                    return;
                }
            }
            $observer->onCompleted();
        });
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Rx\Observable;

use Rx\Observable;
use Rx\ObserverInterface;
use Rx\Scheduler\ImmediateScheduler;
use Rx\SchedulerInterface;

class ArrayObservable extends Observable
{
    private $data;

    public function __construct(array $data)
    {
        $this->data = $data;
    }

    public function subscribe(ObserverInterface $observer, SchedulerInterface $scheduler = null)
    {
        $values    = &$this->data;
        $max       = count($values);
        $keys      = array_keys($values);
        $count     = 0;

        if ($scheduler === null) {
            $scheduler = new ImmediateScheduler();
        }

        return $scheduler->scheduleRecursive(function ($reschedule) use (&$observer, &$values, $max, &$count, $keys) {
            if ($count < $max) {
                $observer->onNext($values[$keys[$count]]);
                $count++;
                if ($count >= 1) {
                    $reschedule();
                    return;
                }
            }
            $observer->onCompleted();
        });
    }
}

Function Calls

None

Variables

None

Stats

MD5 33a5b7b260942f4fe8473773fc5602c9
Eval Count 0
Decode Time 108 ms