1

Works on my localhost running php 5.3.4

Does not work on my VPS hostgator account running 5.3.6

The problem here seems to be the "use" keyword

Code Below

<?php

$video = $this->Video;

$post['Post']['body'] =
    preg_replace_callback("/\[\[audio=(.*)\]\]/", function ($match) use ($video) {
        return $video->show(array('video' => $match[1]));
    }, $post['Post']['body']);

?>

Many thanks for you help.

Rudie
  • 52,220
  • 42
  • 131
  • 173
styks
  • 3,193
  • 1
  • 23
  • 36
  • Works fine on my Windows PHP/5.3.5. What's the error? Syntax? **edit** Are you sure your VPS has PHP >= 5.3? Print `PHP_VERSION` to be sure. – Rudie Oct 16 '11 at 15:29
  • Yes, I am certain. I ran phpinfo to make sure. – styks Oct 17 '11 at 00:52

1 Answers1

0

I had our server admin update the server to 5.3.8 and everything works as normal. Not sure what the problem really was.

styks
  • 3,193
  • 1
  • 23
  • 36