Title: Get Nothing when Calling Function in PHP
Last modified: August 20, 2016

---

# Get Nothing when Calling Function in PHP

 *  Resolved [pdxchambers](https://wordpress.org/support/users/pdxchambers/)
 * (@pdxchambers)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/get-nothing-when-calling-function-in-php/)
 * I’m in the process of developing a calendar plugin. I have a couple of functions`
   nextMonth()` and `prevMonth()` that are supposed to take in an integer value 
   for the month and year and display the calendar for the next/previous month respectively…
   seems pretty simple, however nothing is being displayed and I’ve run out of potential
   ideas…
 *     ```
       function nextMonth ( $month, $year) {
            if ( $month == 12 ) {
                 Display_Calendar( 1, ( $year + 1 ) );
            } else {
                 Display_Calendar ( ( $month + 1 ), $year) );
            }
       }
       ```
   
 * The prevMonth() function is identical except it checks if the month is January
   and returns either December of the previous year or the previous month. I’ve 
   already tested theDisplay_Calendar() function separately and it works perfectly
   fine.
 * In my test code I’m calling the nextMonth() function directly:
 * `echo nextMonth(3, 2012);`
 * What I expect is to see a calendar for April 2012, but I get nothing instead.
   Everything seems to test out semantically, no errors in the IDE, no errors in
   the browser, it simply doesn’t display. Any ideas as to what might be going on
   here?

Viewing 1 replies (of 1 total)

 *  Thread Starter [pdxchambers](https://wordpress.org/support/users/pdxchambers/)
 * (@pdxchambers)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/get-nothing-when-calling-function-in-php/#post-3027726)
 * Just realized the problem… no `return` statement means nothing gets output. Added`
   return` to both functions and they work!
 * **FACEPALM**

Viewing 1 replies (of 1 total)

The topic ‘Get Nothing when Calling Function in PHP’ is closed to new replies.

## Tags

 * [calendar](https://wordpress.org/support/topic-tag/calendar/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [pdxchambers](https://wordpress.org/support/users/pdxchambers/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/get-nothing-when-calling-function-in-php/#post-3027726)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
