Jump to content

[SOLVED] No output?


Recommended Posts

myClass.php:

<?php
class myClass {
     public $myVar = '';

     function myFunction($value){
          return $myVar = $value;
     }

     function useVars(){
          echo $myVar;
     }
}
?>

 

<?php
include 'myClass.php';
$tempC = new myClass();
$tempC->myFunction('I am a cat');
$tempC->useVars();
?>

After running this file, the output would be blank why?

Link to comment
https://forums.phpfreaks.com/topic/103727-solved-no-output/
Share on other sites

This is from the actual file:

 

Fatal error: Cannot access empty property in /home/.marble/ryannaddy/phpsnips.com/phpMagick/phpMagick.php on line 39

<?php
class phpMagick {	
public $input = '';
function set_input($ipt){
	return $this->$input = $ipt;  // Line 39
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/103727-solved-no-output/#findComment-531122
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.